Closed GoogleCodeExporter closed 9 years ago
Great, thanks for your contribution! Just a question - how do you determine #
number of pages using this approach (prior to the conversion being finished)
Original comment by erik.eng...@devaldi.com
on 28 Nov 2011 at 1:49
In my present use case, I actually know in advance how many pages there are in
the PDF, so this doesn't pose a problem; however, I use the following function
to get the number of pages in other contexts:
function pdf_numpages($filename){
exec("pdftk $filename dump_data | grep -i NumberOfPages", $output);
$status = preg_match('/\d+\s*\Z/', $output[0], $matches);
if(empty($matches)){
return 0;
}
return $matches[0];
}
This relies on pdftk, so would entail a dependency on this (there is a Windows
version of pdftk too though)...
Original comment by kmewh...@gmail.com
on 28 Nov 2011 at 2:15
I have added a PHP function for this in our coming version so that there is no
longer a dependency on counting number of pages in the same way as before. I
will also look at incorporating the suggested changes for next version!
Thanks again for your contribution!
Original comment by erik.eng...@devaldi.com
on 2 Dec 2011 at 12:30
and to add to this - we're counting the number of pages without the dependency
of pdftk.
Original comment by erik.eng...@devaldi.com
on 2 Dec 2011 at 12:31
Fixed in latest version of flexpaper (1.5.0)
Original comment by erik.eng...@devaldi.com
on 29 Dec 2011 at 5:19
Original issue reported on code.google.com by
kmewh...@gmail.com
on 26 Nov 2011 at 7:24Attachments: