animation icon indicating copy to clipboard operation
animation copied to clipboard

Number of pages in pdf

Open ggrothendieck opened this issue 3 years ago • 3 comments
trafficstars

It would be nice if there were a function to return the number of pages in a pdf since that can be needed for some calculations. This is already possible using pdftk but is a bit verbose. See https://stackoverflow.com/questions/72289280/split-pdf-files-in-multiples-files-every-2-pages-in-r/72290330#72290330

ggrothendieck avatar May 18 '22 14:05 ggrothendieck

You can use qpdf::pdf_length(). Thanks for the suggestion, though!

yihui avatar May 18 '22 14:05 yihui

The link in my message does point that out but the point is that pdftk itself can do it but it is onerous to access it.

ggrothendieck avatar May 31 '22 19:05 ggrothendieck

Okay, then if anyone wants to contribute a PR, I'll be happy to merge it (although it seems to be beyond the scope of this animation package). Thanks!

yihui avatar Jun 14 '22 01:06 yihui