Extracting pdf page count without using regex

This is a really hacky workaround.

For one, you know that the PDF is always going to have at least one page. You should start looking at page 2. You may also want to try using different numbers than simply incrementing by one. I would suggest even considering exponentially increasing the number and then halving once you get an out of bounds index error until you get to the correct number, like using a searching method on a sorted array.

The real answer is that there should be a new activity that has this functionality since it appears to be pretty fundamental for dealing with PDFs.

1 Like