Hi, I need to get quanity of pages of pdf file linked in InDesign CS4 JS. Here what I have:
var myArtFront = app.activeDocument.pages.rectangles.graphics;
var myLink = myArtFront.itemLink;
var myArtFrontName = myArtFront.itemLink.name;
var myFrontPageNumber = myLink.parent.pdfAttributes.pageNumber;
var pdfPgCount = myLink.pages.length;
and it doesn't return anything.
Thank you for your help.
There has been many discussions on how to get a pdf page count. Search
the forum for various solutions.
I went through all the Forum pages for PDF page count and total pages in PDF from InDesign and couldn't find my specific case. The way I have the access to the PDF in the script is through the link of placed into InDesign file. Would it be sufficient data to pull total count of the pdf pages from the link? None of what I've tried so far worked:
var myArtBack = app.activeDocument.pages.rectangles.graphics;
var myArtBackName = myArtBack.itemLink.name;
var myLink = myArtBack.itemLink;
var pdfPgCount = myArtBack.documentPreference.pagesPerDocument;
var pdfPgCount = myLink.documentPreference.pagesPerDocument;
I think I am stuck in the place of what variable to pass for the pdf doc (green in last 2 lines), so it would give me the pdfPgCount. Do I even have the correct variable defined.
Thank you so much for your help.