Copy link to clipboard
Copied
Hey there again!
I'm now trying to define a preset for the PDF Export process... it's based on the "High Quality Print" (from the Adobe PDF Preset list), and then I want to change "one or two" parameters.
Changing one or two parameters is easy, I've been doing that already, but since most of them are already defined by the "High Quality Print" Preset, my idea was:
How can this be done?
Many thanks!!
Best regards.
Hi,
There are two location of pdfExportPresets basically:
app Folder - "/c/ProgramData/Adobe/Adobe%20PDF/Settings/presetName.joboptions"
user Folder - "~/AppData/Roaming/Adobe/Adobe%20PDF/Settings/presetName.joboptions"
You are able to modify 2nd ones or to duplicate 1st ones (copy from app Folder goes to user Folder).
So 1st step is to duplicate some app preset to user folder (let say changing its name)
and call this copy as a one to be modified by script.
To duplicate use this:
...currPreset = app.pdf
Copy link to clipboard
Copied
I've made some progress... or maybe not.
I've loaded the "High Quality Print" preset to an object, then tried to change that object in a few parameters...
...at that point I get a message telling me that the folder may be protected, maybe it's the object that it's not supposed to be changed?
Here's the code I've used:
myPDFExportPreset=app.pdfExportPresets.item("[High Quality Print]");
// ----------------------------- GENERAL----------------------------------
//pdfExportPresets - exportReaderSpreads=On
myPDFExportPreset.exportReaderSpreads=true;
// ----------------------------- GENERAL----------------------------------
// ----------------------------- COMPRESSION----------------------------------
// ----------------------------- COMPRESSION----------------------------------
// ----------------------------- MARKS and BLEED----------------------------------
//pdfExportPresets - cropMarks=On
myPDFExportPreset.cropMarks=true;
//pdfExportPresets - useDocumentBleedWithPDF=On
myPDFExportPreset.useDocumentBleedWithPDF=true;
//pdfExportPresets - BleedSettings=T0mm T0mm I0mm O0mm
bleedTop='0mm';
bleedBottom='0mm';
bleedInside='0mm';
bleedOutside='0mm';
//pdfExportPresets - includeSlugWithPDF=On
myPDFExportPreset.includeSlugWithPDF=true;
// ----------------------------- MARKS and BLEED----------------------------------
Can anyone spot what's the problem in here? How can I change that preset?
Many thanks again.
Copy link to clipboard
Copied
Hi,
There are two location of pdfExportPresets basically:
app Folder - "/c/ProgramData/Adobe/Adobe%20PDF/Settings/presetName.joboptions"
user Folder - "~/AppData/Roaming/Adobe/Adobe%20PDF/Settings/presetName.joboptions"
You are able to modify 2nd ones or to duplicate 1st ones (copy from app Folder goes to user Folder).
So 1st step is to duplicate some app preset to user folder (let say changing its name)
and call this copy as a one to be modified by script.
To duplicate use this:
currPreset = app.pdfExportPresets.item("[High Quality Print]").duplicate();
currPreset.name = "myHResPreset";
After this you can modify your script's 1st line:
myPDFExportPreset=app.pdfExportPresets.item("myHResPreset");
and run your code
Jarek
Copy link to clipboard
Copied
Jump_Over wrote:
Hi,
There are two location of pdfExportPresets basically:
app Folder - "/c/ProgramData/Adobe/Adobe%20PDF/Settings/presetName.joboptions"
user Folder - "~/AppData/Roaming/Adobe/Adobe%20PDF/Settings/presetName.joboptions"
You are able to modify 2nd ones or to duplicate 1st ones (copy of app Folder goes to user Folder).
So 1st step is to duplicate some app preset to user folder (let say changing its name)
and call this copy as a one to be modified by script.
To duplicate use this:
After this you can modify your script's 1st line:
myPDFExportPreset=app.pdfExportPresets.item("myHResPreset");
and run your code
AaaaaaaaaaaaH!!!! Thanks Jump_Over... I think that's the thing I was missing.
I'll try it later when I get home and I'll tell the result.
But I think that's exactly what I've needed.
Copy link to clipboard
Copied
Hi there Jump_Over,
I had a "little" delay trying your solution... but here I am.
Just tested it and it worked like a million bucks!!
Thanks for the help!
Copy link to clipboard
Copied
@m8r-vrpa5v – I think, it is not best practice to change a default PDF Export Preset. Instead I would add a new preset based on the default one.
When looking at your code you have to use the right syntax.
Every time you assign a value to a property you have to use the right object that property belongs to.
Some values are only functional, if some other property is set (this goes especially for the bleed settings).
Do not write:
bleedTop='0mm';
ExtendScript cannot know by itself where this property and its value should be assigned to what object.
Right syntax would be:
myPDFExportPreset.bleedTop='0mm';
Or (I used no meassurement units, the value 0 does not require this):
myPDFExportPreset.properties = {
useDocumentBleedWithPDF : true,
bleedTop : 0 ,
bleedBottom : 0 ,
bleedInside : 0 ,
bleedOutside : 0
}
Here a link to an ExtendScript resource that will tell you (nearly) everything about objects, methods, properties and values you can use:
Jongware
InDesign JavaScript Reference Guide
http://www.jongware.com/idjshelp.html
The chm-files are best for searchability.
Uwe
Copy link to clipboard
Copied
Uwe Laubender wrote:
@m8r-vrpa5v – I think, it is not best practice to change a default PDF Export Preset. Instead I would add a new preset based on the default one.
When looking at your code you have to use the right syntax.
Every time you assign a value to a property you have to use the right object that property belongs to.
Some values are only functional, if some other property is set (this goes especially for the bleed settings).
Do not write:
bleedTop='0mm';
ExtendScript cannot know by itself where this property and its value should be assigned to what object.
Right syntax would be:
myPDFExportPreset.bleedTop='0mm';
Or (I used no meassurement units, the value 0 does not require this):
myPDFExportPreset.properties = { useDocumentBleedWithPDF : true, bleedTop : 0 , bleedBottom : 0 , bleedInside : 0 , bleedOutside : 0 }
Hi Uwe,
Thanks for your remark... that was my mistake when using copy paste.
I was reusing code from another script where I used the WITH function, in here I was using a different structure and I didn't correct this.
But thanks again for the remark!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now