ref: 13508a99a8955b98609ec7dcbf5f57069179a4de
parent: 581f3852fe94949ab53b876d35ce2361240d6862
author: cinap_lenrek <[email protected]>
date: Thu Feb 19 06:44:16 EST 2015
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.
--- a/sys/lib/ghostscript/pdf_base.ps
+++ b/sys/lib/ghostscript/pdf_base.ps
@@ -412,11 +412,10 @@
( **** 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 { % <object#> <generation#> R <object>
--- a/sys/lib/ghostscript/pdf_main.ps
+++ b/sys/lib/ghostscript/pdf_main.ps
@@ -25,6 +25,8 @@
% 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 <bool>