I want to make sure to clear up what pdf_burst() does, it returns an
array of abs paths to files that each represent a page of your
original document.
It does not return a value that represents how many pages were burst
from your original pdfs.
That said, the error happens under these conditions:
If you have PDF::Burst configured to burst with pdftk.
You call burst for /tmp/doc1.pdf with 20 pages, and then overrite
/tmp/doc1.pdf with another document that has 10 pages, and call pdf
burst again, you get 20 pages in the array.
I think it's horrid practice to do this in the first place, why are
you bursting a pdf in to documents and not doing something *with* the
files, or deleting them afterwards? or giving them another 'group
name'?
Beats me.
*That* said, yes, this is a bug.
A fix has been introduced. The fix will attempt to read the
doc_data.txt file created by pdftk (inot the cwd, which is altered and
then set back) when you burst. It should contain a page number. If a
page number exists, we compare and warn accordingly- furthermore if we
get extra pages, we prune the end to match.
This should fix the op concern.
The new release is PDF-Burst-1.19
http://cpansearch.perl.org/src/LEOCHARRE/PDF-Burst-1.19/Changes
It should be appearing on cpan after 2009/05/27 3pm eastern time zone.
On 5/27/09, Andreas Hernitscheck via RT <bug-PDF-Burst@rt.cpan.org> wrote:
Show quoted text> Queue: PDF-Burst
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=46351 >
>
>
> Hi,
>
> yes its true, I am using pdftk.
>
> And it it exactly caused by the reason you describe.
>
> But IMHO your lib should return a correct value independent from my
> script, because by the simple reason you expect it from this method.
>
> I split several PDFs in a loop, that is the reason for this effect. Of
> course, now I clean up the folder before, but like I said, this script
> should return a valid value. So far consider to add this info to your doc.
>
> maybe doing a trick to copy the file to a new name with a random number
> would do it. Or something by comparing file attributes?
>
>
>
--
Leo Charre