Has somebody a method to get the number of pages in an InDesign-file in Switch?
The variable [Stats.NumberOfPages] does not return anything. And I can not see anything in the XMP about this.
Number of pages of InDesign-file
- JimmyHartington
- Advanced member
- Posts: 316
- Joined: Tue Mar 22, 2011 7:38 am
Re: Number of pages of InDesign-file
Hi Jimmy,
- You can use an InDesign script for this. You will probably need to output the number of pages value in an xml file, or in the name of the output file.
- You can convert your InDesign file to a pdf file, define a private data with [Stats.NumberOfPages], then re-inject your InDesign file (previously stored in a repository.
Laurent De Wilde, Solution Architect @ Enfocus
- JimmyHartington
- Advanced member
- Posts: 316
- Joined: Tue Mar 22, 2011 7:38 am
Re: Number of pages of InDesign-file
Hi Laurent
Thanks for the suggestions.
I know I could do it in other ways, but was unsure if there were a more direct way to get the data, without needing to open/process the InDesign-file.
Thanks for the suggestions.
I know I could do it in other ways, but was unsure if there were a more direct way to get the data, without needing to open/process the InDesign-file.
Re: Number of pages of InDesign-file
I think there is page information in the XMP?
This Switch variable gives the highest page number in my test:
[Metadata.Integer:Path="xmp:PageInfo/*[last()]/xmpTPg:PageNumber"]
In InDesign this is of course not always equal to the amout of pages since you can start a document with any page number you want.
But I guess using scripting you should be able to get the amount of pages from the xmp by counting the items in the xmp:PageInfo element.
If you don't want to process the InDesign file, then I think XMP is your only option.
This Switch variable gives the highest page number in my test:
[Metadata.Integer:Path="xmp:PageInfo/*[last()]/xmpTPg:PageNumber"]
In InDesign this is of course not always equal to the amout of pages since you can start a document with any page number you want.
But I guess using scripting you should be able to get the amount of pages from the xmp by counting the items in the xmp:PageInfo element.
If you don't want to process the InDesign file, then I think XMP is your only option.
- JimmyHartington
- Advanced member
- Posts: 316
- Joined: Tue Mar 22, 2011 7:38 am
Re: Number of pages of InDesign-file
In my tests it seems this metadata is based on the setting in InDesign, which can save a preview of each page.
And since I have it set to 5 pages, then all my InDesign files are reported as being 5 pages.
I could set it to all pages, but then it takes to long to save really big files.
Re: Number of pages of InDesign-file
You can lower the indesing saving time for all pages by lowering the preview resolution. But that may be a problem if you use the preview.
- JimmyHartington
- Advanced member
- Posts: 316
- Joined: Tue Mar 22, 2011 7:38 am
Re: Number of pages of InDesign-file
We use the preview internally to preview files with Quick-look before opening. Which is why I prefer 5 pages with higher resolution instead of all pages at lower resolution.