From 13508a99a8955b98609ec7dcbf5f57069179a4de Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 19 Feb 2015 11:44:16 +0100 Subject: gs: work arround broken xref table pdfs rebuilding the xref table does not work for pdfs with compressed object streams. as a work arround, we skip xref table verification and ignore wrong xref gen # for gen 0 objects. --- sys/lib/ghostscript/pdf_base.ps | 7 +++---- sys/lib/ghostscript/pdf_main.ps | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/lib/ghostscript/pdf_base.ps b/sys/lib/ghostscript/pdf_base.ps index 710e15c79..438762cfb 100644 --- a/sys/lib/ghostscript/pdf_base.ps +++ b/sys/lib/ghostscript/pdf_base.ps @@ -412,11 +412,10 @@ pdfdict begin ( **** Warning: wrong generation: ) } ifelse 2 index =string cvs concatstrings ( ) concatstrings % put obj # - exch =string cvs concatstrings ( R\n) concatstrings % put gen # + 1 index =string cvs concatstrings ( R\n) concatstrings % put gen # pdfformaterror % Output warning message - } { % Else QUIET ... - pop % Pop generation umber - } ifelse false % Return false if gen # not match + } if + 0 eq } ifelse } bind def /R { % R diff --git a/sys/lib/ghostscript/pdf_main.ps b/sys/lib/ghostscript/pdf_main.ps index c4c352085..12ee8e6fc 100644 --- a/sys/lib/ghostscript/pdf_main.ps +++ b/sys/lib/ghostscript/pdf_main.ps @@ -25,6 +25,8 @@ pdfdict begin % Patch in an obsolete variable used by some third-party software. /#? false def +/NoVerifyXref true def + % Test whether the current output device handles pdfmark. /.writepdfmarkdict 1 dict dup /pdfmark null put readonly def /.writepdfmarks { % - .writepdfmarks -- cgit v1.2.3