Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PDF Export Page Range Options (First and Last), Codes

New Here ,
Oct 29, 2019 Oct 29, 2019

Hi there, 

 

My scenario to help explain is this... I have designed a book that will have a thick paper cover, and a thinner body paper, all inside one document in InDesign . In order for my printer to do this I need to export the book cover as one PDF file, and the body pages as another PDF file. I would like to be able to export like this from InDesign, so in my Export Dialog Box I could write in the Page Range "1,2,**,***".

SO, ** would represent the second last page, and the *** would be the LAST page... but not as numbers, rather, as a code to represent the fact that its the second last and last page... (Hoping this is making sense!). 

The benefit of knowing if there is a code for these two pages (or any code other than a numerical value) would be I could save a PDF Export Preset with this code being Page Range = 1,2,**,*** and it would ALWAYS pick the second last AND last page in my export.  

All in all, my question is... Do the pages in InDesign have a way to recognise what page they are without a number, primarily if there is a code for the LAST PAGE, and the SECOND LAST Page... etc.. 

Its not the biggest deal, it would just save some time. 

 

Thanks! If this is confusing I will try to go into further detail

 

Tom 

914
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 30, 2019 Oct 30, 2019
LATEST

Hi Tom,

PDF Export Presets cannot store page ranges of any kind. InDesign itself will do that.

It will always* remember the last range you exported for your next export. Even if you quit InDesign and restart, InDesign will remember the last range you did. That is independent from the used export preset.

 

*Well, not exactly always:

If the number of pages of your document will not allow the remembered range, InDesign will reset the range to "All".

 

Pages can be addressed by absolute numbering, means the position of the page inside a document without knowing the actual page name or number: +1 e.g. always means the first page in a document, +2 the second page and so forth. Hm. I cannot see how you can assign the last page in a way without knowing the number of pages in a document.

 

By scripting ( ExtendScript/JavaScript ) one can change the page range for:

the first page, the second page, the page before the last page, the last page of the active document

e.g.like that:

 

 

/*
	Set the page range for PDF Export to:
	
	the first page,
	the second page,
	the page before the last page,
	the last page
	
	of the active document
	if the number of pages is 4 or above.
*/

var pageLength = app.documents[0].pages.length;

if( pageLength >= 4 )
{
	app.pdfExportPreferences.pageRange = 
	"+1,+2,+" +( pageLength-1 ) +",+" +pageLength;
};

 

 

Important: With a new document with a different number of pages you have to run the script again.

 

Regards,

Uwe Laubender

( ACP )

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines