Copy link to clipboard
Copied
I need to import a multiple page PDF into FrameMaker. I can specify each page number and it works successfully, but the missing piece is knowing how many pages are in the PDF. With FrameScript, I can use its EActiveXObject object to query the PDF and find out the number of pages. It can also be done with InDesign ExtendScript by using its app.doScript method to pass some Visual Basic to the PDF, returning its page count. I am trying to figure out how to do this with FrameMaker ExtendScript. Any ideas would be appreciated.
One thing I tried: I was hoping that once the page number I passed to the Import method exceeded the number of pages in the PDF that the command would fail. But it doesn't; it simply imports page 1.
Rick
Copy link to clipboard
Copied
There's some simple JaavScript code in this thread that just searches the PDF for various regular expressions:
Copy link to clipboard
Copied
var Lpage = newDoc.numPages; will provide the total page count
Copy link to clipboard
Copied
IMHO the most reliable method is described here (following a link from previous posts):
https://forums.adobe.com/message/1112710#1112710
I have tested this with various items.
Klaus