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
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
...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");
Copy link to clipboard
Copied
No page name 26.5
Copy link to clipboard
Copied
I need help to solve this issue. While exporting the section pages all the pages got exported.
Copy link to clipboard
Copied
But you got answer for this same question from Peter, isn't it?
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
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:
Regards,
Uwe
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");
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.
Uwe
Copy link to clipboard
Copied
By using Alternate Layouts this game is getting really funny:
"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
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...
Copy link to clipboard
Copied
Well, it could also be chapter number with an introductory page and subchapter numbering.
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
Copy link to clipboard
Copied
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.