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

Export PDF various sections

Engaged ,
Aug 03, 2016 Aug 03, 2016

Copy link to clipboard

Copied

I needs to export PDF via script. In my document have so many sections. How to do this.

While export the PDF its to to custom

I have copied my code

var printpage =  '16-16.2,26-26.5,12-14'

app.interactivePDFExportPreferences.pageRange = String (printpage);

app.interactivePDFExportPreferences.exportReaderSpreads = false;

pdfname = app.activeDocument.name.replace (".indd", "");

app.activeDocument.exportFile(ExportFormat.INTERACTIVE_PDF, new File(app.activeDocument.filePath.fullName + "/" + pdfname +".pdf"),true);

Its throw the below exception and all the pages get pDF

ExportPDF.PNG

TOPICS
Scripting

Views

774

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Aug 04, 2016 Aug 04, 2016

sreekarthik.k@gmail.com wrote:

I need help to solve this issue. While exporting the section pages all the pages got exported.

First find out what is the documentOffset of a page you want to export. That returns a number object.

Then use absolute page names for your export string.

Add 1 to the returned number and transform that number to a string.

Add "+" in front of the string, separate the next name by comma.

Example for the first three pages of a document regardless of naming:

"+1,+2,+3"

More examples

...

Votes

Translate

Translate
Engaged ,
Aug 03, 2016 Aug 03, 2016

Copy link to clipboard

Copied

What "26.5" means? You can't export half page...

Also, your screenshot didn't show error - it shows exporting options

And while you replacing file extension - you can do in in one pass:

pdfname = app.activeDocument.name.replace (/indd$/, "pdf");

Votes

Translate

Translate

Report

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
Engaged ,
Aug 03, 2016 Aug 03, 2016

Copy link to clipboard

Copied

No page name 26.5

Votes

Translate

Translate

Report

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
Engaged ,
Aug 03, 2016 Aug 03, 2016

Copy link to clipboard

Copied

I need help to solve this issue. While exporting the section pages all the pages got exported.

Votes

Translate

Translate

Report

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
Guide ,
Aug 03, 2016 Aug 03, 2016

Copy link to clipboard

Copied

But you got answer for this same question from Peter, isn't it?

Re: urgent help export INTERACTIVE_PDF selected page

Votes

Translate

Translate

Report

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 ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

sreekarthik.k@gmail.com wrote:

I need help to solve this issue. While exporting the section pages all the pages got exported.

First find out what is the documentOffset of a page you want to export. That returns a number object.

Then use absolute page names for your export string.

Add 1 to the returned number and transform that number to a string.

Add "+" in front of the string, separate the next name by comma.

Example for the first three pages of a document regardless of naming:

"+1,+2,+3"

More examples:

"+4-" means export 4th page of the document to the end.

"-+4" means export up to and including the 4th page of a document.

Explanation:
You could come accross a document where several pages have the same name.
( And other cases… )

Regards,
Uwe

Votes

Translate

Translate

Report

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 ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

You can find some other notations for section numbering in the help files.

Scroll down to Examples of page ranges:

Print documents in InDesign

Regards,
Uwe

Votes

Translate

Translate

Report

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
Engaged ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

Well, I knew that it's possible to change page names, but didn't think that someone might want to have pages from 16 to 16.2 or from 26 to 26.5 - this just don't make any sense to me, but anyway, try this and let us know if this works for you

function exportPages(pages){

    app.interactivePDFExportPreferences.pageRange = pages.replace(/[0-9\.]+/g, "+$&");

    app.interactivePDFExportPreferences.exportReaderSpreads = false;

    pdfname = app.activeDocument.name.replace (/indd$/, "pdf");

    app.activeDocument.exportFile(ExportFormat.INTERACTIVE_PDF, app.activeDocument.filePath.fullName + "/" + pdfname, true);

}

exportPages("16-16.2,26-26.5,12-14");

Votes

Translate

Translate

Report

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 ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

oleh.melnyk wrote:

… didn't think that someone might want to have pages from 16 to 16.2 or from 26 to 26.5 - this just don't make any sense to me …

All's possible. 🙂

Example for page names in order of appearance:
( all strings of course )

16

16.1

16.2

16.3

26

26.1

26.2

The ones with the dots will use prefixes.

PageNamingUsingPrefix.png

Uwe

Votes

Translate

Translate

Report

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 ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

By using Alternate Layouts this game is getting really funny:

PageNamingUsingPrefix-AlternateLayouts.png

"Benutzerdefiniert" is "User defined" or "Custom" ( don't know how this string will be translated to an English locale ). And here we have another issue: Localized strings come into play as well.

Uwe

Votes

Translate

Translate

Report

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
Engaged ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

Hi Uwe,

Well, I think the only logical case for using 26-26.5 pages might be multi-spread, like gatefold or something like that...

pageNumbering.jpg

Votes

Translate

Translate

Report

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 ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

Well, it could also be chapter number with an introductory page and subchapter numbering.

Votes

Translate

Translate

Report

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
Engaged ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

It might be anything, but important thing is that if all that is one page (single piece of paper) - then it can be 26-26.5, but if this is different pages in the section - then it's better to use another numbering

Votes

Translate

Translate

Report

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
Engaged ,
Aug 04, 2016 Aug 04, 2016

Copy link to clipboard

Copied

LATEST

The same page numbers repeated in some other section that what the export method is not working. I have solved the issue before renumber the section.

Again thanks all and your suggestions.

Votes

Translate

Translate

Report

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