Copy link to clipboard
Copied
How to create single pages pdf for the selected range using script. Unable to find a solution through the forum except looping through pages.
Hi @Singaaram , there are the exportAsSinglePages and singlePagesPDFSuffix properties in pdfExportPreferences. This exports pages 2 and 4 to a chosen folder using the PDF/X-4 preset
var f = Folder.selectDialog("Select a folder for the PDF pages");
var doc = app.documents.item(0);
var n = doc.name.replace(/\.[^\.]+$/, '')
var thePath = f + "/" + n + ".pdf";
var preset=app.pdfExportPresets.itemByName("[PDF/X-4:2008]");
//the exportAsSinglePages property set to true exports single pages. T
...
Copy link to clipboard
Copied
Presumably, you are aware of the "Create Separate PDF Files" facility in the Export Adobe PDF dialogue box?
Copy link to clipboard
Copied
Hi Derek,
Thanks. Yes I am aware of that. But in a scripting I don't know how to integrate this in pdf creation.
I have this code only. But this did not worked for ranges. So I had to make alternate solution.
Copy link to clipboard
Copied
Hi @Singaaram , there are the exportAsSinglePages and singlePagesPDFSuffix properties in pdfExportPreferences. This exports pages 2 and 4 to a chosen folder using the PDF/X-4 preset
var f = Folder.selectDialog("Select a folder for the PDF pages");
var doc = app.documents.item(0);
var n = doc.name.replace(/\.[^\.]+$/, '')
var thePath = f + "/" + n + ".pdf";
var preset=app.pdfExportPresets.itemByName("[PDF/X-4:2008]");
//the exportAsSinglePages property set to true exports single pages. The singlePagesSuffix set to _the page number
app.pdfExportPreferences.properties = {pageRange:"2,4", exportAsSinglePages:true, singlePagesPDFSuffix:"_^P"}
doc.exportFile(ExportFormat.pdfType, File(thePath));
Copy link to clipboard
Copied
Hi @rob day, Thank you so much.
That works perfectly.🤟🏼🤩