• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Export PDF - Marks and Bleed - Offset Value

Contributor ,
May 25, 2018 May 25, 2018

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??

TOPICS
Scripting

Views

3.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 28, 2018 May 28, 2018

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

...

Votes

Translate

Translate
Community Expert ,
May 27, 2018 May 27, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 27, 2018 May 27, 2018

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.Screen Shot 2018-05-28 at 10.29.32 AM.png

Screen Shot 2018-05-28 at 10.41.27 AM.png

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)

    }

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 28, 2018 May 28, 2018

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 28, 2018 May 28, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 28, 2018 May 28, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 29, 2018 May 29, 2018

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;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 29, 2018 May 29, 2018

Copy link to clipboard

Copied

LATEST
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)!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines