From b7a795345dfc692e6c37194cc484ad5bc0ce7b3c Mon Sep 17 00:00:00 2001 From: Ken Sharp Date: Fri, 23 Sep 2022 15:46:20 +0100 Subject: GhostPDF - Some error/warning cases not flagged with PDFSTOPON* Bug #705900 "Ghostscript - parameter PDFSTOPONWARNING doesn't stop on all warnings and errors" The first case here is actually in the PostScript interpreter and so does not strictly affect GhostPDF. When executing 'run' on a PDF file the PostScript code checks to see if the header was at the start of the file and emits a warning if not. We now check PDFSTOPONWARNING after that and exit with an error if it is true. The xref checking (very early part of the new interpreter, predates the arguments) was repairing files without first checking if it should exit (if PDFSTOPONERROR is true). --- Resource/Init/pdf_main.ps | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Resource/Init') diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps index cf1825dfb..a20c95f54 100644 --- a/Resource/Init/pdf_main.ps +++ b/Resource/Init/pdf_main.ps @@ -1216,6 +1216,9 @@ currentdict /PDFSwitches undef (%stderr) (w) file dup ( **** Warning: File has some garbage before %PDF- .\n) writestring flushfile + PDFSTOPONWARNING { + /run cvx /unregistered signalerror + } if } { pop } ifelse -- cgit v1.2.1