Copy link to clipboard
Copied
Hi,
I need to change Export Adobe PDF - > Marks and Bleeds -> Offset Value when export pdf file with preset offset.
Can able to change this option when using preset options with export pdf??
I am using preset to export pdf. When using preset also need to change that offset value. Is it possible??
OK, I set prefs to in and made a preset using 1 in offset. Inspecting the .joboptions file in a text editor I see the following:
/MarksOffset 72
And again, for half in bleed, the result is:
/MarksOffset 36
So the native unit of measure appears to be PostScript Points 1/72 in.
Entering 15mm, the result is:
/MarksOffset 42.51968
(which again is points)
So even though the .joboptions file is in pt, as Jongware reports the script reporting in mm, unless a further conversion such as in my previous post is us
...Copy link to clipboard
Copied
Yes, it is possible. See https://www.indesignjs.de/extendscriptAPI/indesign-latest/#PDFExportPreference.html
Tip: Add that site to your bookmarks, so you can search first before asking.
Copy link to clipboard
Copied
Hi,
Thank your for your reply..
I am using the below code to get existing page mark offset value of preset file. But its not returning the correct value. Don't know why its occurring... Pls refer screenshots.
var jobOptionName = "test";
alert(app.pdfExportPresets.everyItem().getElements().length)
var mypdfExportPresets = app.pdfExportPresets.everyItem().getElements();
for(i=0; i<mypdfExportPresets.length; i++)
{
var pdfPresetsName = mypdfExportPresets.name;
if(pdfPresetsName == jobOptionName )
{
pPreset = mypdfExportPresets;
alert("pPreset" + pPreset.name + "\n" + pPreset.pageMarksOffset)
}
}
Copy link to clipboard
Copied
It appears that the PDF Export GUI is picking up the application prefs which are in inches.
The script is reporting via metric mm, where 25.4mm = 1 inch. Were the export job option saved when prefs were set to mm, then the prefs changed to in?
I don’t know why though, perhaps mm is the native unit of the .joboptions file, just as PostScript points are the native unit for PDF… Or perhaps the unit and value is captured from prefs when the job option is first created.
Changing line 13 to convert from mm to in:
alert("pPreset" + pPreset.name + "\n" + pPreset.pageMarksOffset / 25.4)
Copy link to clipboard
Copied
Looks like a (long standing!) bug.
The dialog uses the active Vertical measurement units to display the current value, but in a script it always seems to be reported in mm. This is contradicting the description in the ESTK help:
PDFExportPreference.pageMarksOffset
Data Type: Measurement Unit (Number or String)
Adobe InDesign CS4 (6.0) Object Model
The offset from the edge of the page for page marks.
which is the usual description for "any" measurement unit or string. (Although it still accepts strings such as '15pt', and correctly recalculates them into mm.) As far as I know, all other "Measurement Unit (Number or String)" fields always return their value in the current measurement units.
("Long standing" because not only does this fail in my brand new CC 2017 13.1, but also in the daily workhorse CS4. I did not check but it strongly suggests 'all versions in between' also have this bug.)
Report this on Adobe InDesign: Bugs: Hot (963 ideas) – Adobe InDesign Feedback as a bug.
Copy link to clipboard
Copied
OK, I set prefs to in and made a preset using 1 in offset. Inspecting the .joboptions file in a text editor I see the following:
/MarksOffset 72
And again, for half in bleed, the result is:
/MarksOffset 36
So the native unit of measure appears to be PostScript Points 1/72 in.
Entering 15mm, the result is:
/MarksOffset 42.51968
(which again is points)
So even though the .joboptions file is in pt, as Jongware reports the script reporting in mm, unless a further conversion such as in my previous post is used.
Copy link to clipboard
Copied
Hi,
Thank you for the reply...
As discussed here, i check the job option file in textedit values are there in points but script returning in mm.
So I have used the value with measurement units to set page marks offset value.
var resUnit = "in"
presetFile.pageMarksOffset = app.activeDocument.documentPreferences.documentBleedTopOffset + resUnit;
Copy link to clipboard
Copied
var resUnit = "in"
As I can’t write scripts, your use of a variable is certainly more elegant than my hack in post #3 suggesting that you divide the output by 25.4 (even though both should lead to the same answer)!