Skip Menu |

This queue is for tickets about the PDF-Reuse CPAN distribution.

Report information
The Basics
Id: 97290
Status: resolved
Priority: 0/
Queue: PDF-Reuse

People
Owner: cnighs [...] cpan.org
Requestors: ken [...] nsds.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.36_03



Subject: fix for uninitialized value $param{"Index"} when reading PDF version 1.5 file
Date: Wed, 16 Jul 2014 10:45:09 -0700
To: bug-PDF-Reuse [...] rt.cpan.org
From: Ken Neighbors <ken [...] nsds.com>
When I try to create a new PDF file using "prDoc" by extracting a few pages from an existing PDF version 1.5 file, I get this error message: Use of uninitialized value $param{"Index"} in pattern match (m//) at blib/lib/PDF/Reuse.pm (autosplit into blib/lib/auto/PDF/Reuse/crossrefObj.al) line 4275. (And a bunch of other error messages.) I did a search and found out that the "Index" parameter is optional, and has a default value of "[0 Size]" according to this post: http://stackoverflow.com/questions/4556288/pdf-cross-reference-streams So I added a check to the crossrefObj subroutine in Reuse.pm which sets this parameter to the default value if it is missing. --- Reuse.pm.orig 2008-07-03 13:06:12.000000000 +0000 +++ Reuse.pm 2014-07-16 17:41:45.618989078 +0000 @@ -4245,6 +4245,9 @@ { $param{$1} = $2 || ' '; } } + if (! exists $param{'Index'}) + { $param{'Index'} = "[0 $param{'Size'}]"; + } if ((exists $param{'Root'}) && ($param{'Root'} =~ m'^\s*(\d+)'o)) { $tempRoot = $1; } Now it works, at least on my file. Hope this helps. Ken
This fix has been applied to a testing branch in my repo on Github. Please either grab a copy from there or form the zip link below and verify that this fixes the issue. After the fix is verified, I will push it in the next stable release. https://github.com/cnighswonger/PDF-Reuse/archive/bugs/97290.zip
Subject: Re: [rt.cpan.org #97290] fix for uninitialized value $param{"Index"} when reading PDF version 1.5 file
Date: Mon, 8 Dec 2014 09:53:30 -0800
To: bug-PDF-Reuse [...] rt.cpan.org
From: Ken Neighbors <ken [...] nsds.com>
I downloaded the patched PDF::Reuse from the zip link you provided, I tested it on a PDF 1.5 file, and it worked without a problem so the issue has been fixed. Thanks!​