Copy link to clipboard
Copied
I completed a press job in which copy was only on the odd pages with a design on the even pages (same on all even pages). After it was complete, the customer decided they wanted a copy with only the odd pages to display on a screen during an event. I was looking for a way to export a PDF of only the odd pages but didn't find it. It was easy to do with printing to a PDF -- there I could either print only odd or even pages or just choose to not print blank pages (after deleting the content on the even side master page). I've learned here that one should always use export rather than printing to PDF -- is there any (easy) way to accomplish this task with export?
Here's a link to an efficient method to delete unwanted pages in Acrobat:
Copy link to clipboard
Copied
The easiest way to do this is to export the PDF as usual, and in the Range field, type the name of all the odd pages separate by a comma:
1,3,5,7,9,11,13 etc.
(Use Excel or something to create the list of numbers).
Copy link to clipboard
Copied
I guess that is the easiest way -- but for me printing to PDF was much easier. I think that a one point ID's PDF presents included an option to skip blank pages, didn't it? I would think there should still be such an option and/or one to print only odd or even pages.
Copy link to clipboard
Copied
Auto page numbering, threaded text frames through pages? If none, you could try this script for deleting even pages and exporting then:
var curpage = 1;
app.activeDocument.pages[curpage].remove();
while (curpage < app.activeDocument.pages.length)
{
try{
curpage += 1;
app.activeDocument.pages[curpage].remove();
}catch(e){};
}
dirty workaround, I know...
Copy link to clipboard
Copied
That could work -- no threaded text frames and no page numbering. Still seems like overkill for what should be a simple task.
Copy link to clipboard
Copied
yeah, life's not easy. But interesting
say this for devs.
we're just poor users here.
Copy link to clipboard
Copied
For documents with many pages you can script the PDF's page range field. This AppleScript (OSX only) will do it for the active document:
tell application "Adobe InDesign CC 2014"
set p to ""
try
repeat with i from 1 to count of pages of active document
if i mod 2 is 1 then
set p to p & i & ", " as string
end if
end repeat
set p to characters 1 thru ((count of p) - 2) of p
set page range of PDF export preferences to (p as string)
invoke (item 1 of every menu action whose id is 113411)
end try
end tell
So for a 500 page document you get this:
Copy link to clipboard
Copied
Rob, that won't work for me as I'm on a PC. It could probably be scripted for a PC too, but it seems that Luke's suggestion is simpler. Thank you.
Copy link to clipboard
Copied
In case you want to try it the JS is:
http://www.zenodesign.com/forum/oddPages.zip
main();
function main(){
var p ="";
for(i = 0; i < app.activeDocument.pages.length; i++){
if (i%2==1){
p=p+i+", "
}
}
app.pdfExportPreferences.pageRange=p
app.menuActions.itemByID(113411).invoke();
}
Copy link to clipboard
Copied
rob day wrote:
In case you want to try it the JS is:
main(); function main(){ var p =""; for(i = 0; i < app.activeDocument.pages.length; i++){ if (i%2==1){ p=p+i+", " } } app.pdfExportPreferences.pageRange=p app.menuActions.itemByID(113411).invoke(); }
Am I supposed to edit the script or something? Now, when I run it (ID CC 2015), it just takes me to the export dialog but doesn't change the pages to export. Have I missed a step?
Copy link to clipboard
Copied
Hmmm, I'm testing on a Mac in 2014, I also forgot to trim the extra comma at the end of the page range in the Javascript version and that might be a problem. So you could try this version:
http://www.zenodesign.com/forum/oddPages2.zip
main();
function main(){
var p ="";
for(i = 0; i < app.activeDocument.pages.length; i++){
if (i%2==1){
p=p+i+", "
}
}
p = p.substring(0, p.length - 2);
app.pdfExportPreferences.pageRange=p
app.menuActions.itemByID(113411).invoke();
}
Which gives me this for an 8 page doc:
Copy link to clipboard
Copied
rob day wrote:
Hmmm, I'm testing on a Mac in 2014, I also forgot to trim the extra comma at the end of the page range in the Javascript version and that might be a problem. So you could try this version:
main(); function main(){ var p =""; for(i = 0; i < app.activeDocument.pages.length; i++){ if (i%2==1){ p=p+i+", " } } p = p.substring(0, p.length - 2); app.pdfExportPreferences.pageRange=p app.menuActions.itemByID(113411).invoke(); }
Which gives me this for an 8 page doc:
No, that didn't work either; still just took me to the standard export dialog.
Copy link to clipboard
Copied
Did you try the compiled version in the zip archived I linked, or are you cut and pasting the code?
Copy link to clipboard
Copied
rob day wrote:
Did you try the compiled version in the zip archived I linked, or are you cut and pasting the code?
Yes, I downloaded the ZIP and used that version.
Copy link to clipboard
Copied
Here's a link to an efficient method to delete unwanted pages in Acrobat:
Copy link to clipboard
Copied
Luke, thank you. That actually will work in ID as well -- I've even done something similar. Don't know why I didn't think of it here.