Subject: | qQ imbalance in Reuse.pm |
Lars --
Thanks for PDF::Reuse it's a very nice piece of work !
I have been testing the .pdf output and when comverting .pdf files
created by PDF::Reuse to .ps files via ghostscript, I received the
following warnings:
[konrad@kjhlt4 ME.941C]$ pdf2ps
/home/konrad/prj/mag-media/ME/ME.941C/forms/ME941C/merged/ME941C1-46-2010-Q1.pdf
**** Warning: File has imbalanced q/Q operators (too many q's)
**** Warning: File has imbalanced q/Q operators (too many q's)
**** Warning: File has imbalanced q/Q operators (too many q's)
**** Warning: File has imbalanced q/Q operators (too many q's)
**** Warning: File has imbalanced q/Q operators (too many q's)
**** Warning: File has imbalanced q/Q operators (too many q's)
**** Warning: File has imbalanced q/Q operators (too many q's)
**** Warning: File has imbalanced q/Q operators (too many q's)
**** This file had errors that were repaired or ignored.
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
**** specification.
I located the offending line of code and attached a .patch file for
Reuse.pm to balance the qQ pair.
I have installed PDF::Reuse version 0.35 and I am running on perl 5.5.8
on Linux i386 and on Windows( ActiveState Perl ).
Thanks again ! PDF::Reuse is indespensible !!
-- kjh
Subject: | Reuse.pm.patch |
--- Reuse~01.pm 2008-07-03 08:06:12.000000000 -0500
+++ Reuse.pm 2010-07-14 07:31:56.000000000 -0500
@@ -945,7 +945,7 @@
{ $objNr++;
$objekt[$objNr] = $pos;
- $stream = "\nq\n1 0 0 1 $devX $devY cm\n/Xwq Do\nq\n";
+ $stream = "\nq\n1 0 0 1 $devX $devY cm\n/Xwq Do\nQ\n"; # kjh fixed qQ imbal
$langd = length($stream);
$confuseObj = $objNr;
$stream = "$objNr 0 obj<</Length $langd>>stream\n" . "$stream";