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

Text Variable for PDF Trim Box

New Here ,
Aug 22, 2020 Aug 22, 2020

Copy link to clipboard

Copied

Hello-

 

I am looking for a way to add a PDFs trim box dimensions as a caption using a script or text variable. 

 

Final Goal: I have to create a multipage production proof that includes an image of each document being printed and include the dimensions of that document for the pressman to reference. I have a job with over 100 pieces of artwork and need a way to reduce the amount of time it takes to create the production proof. 

TOPICS
How to , Scripting

Views

341

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 , Aug 24, 2020 Aug 24, 2020

Here's a more simplified version. Create a text frame and select it with your black arrow. Then run this script. To install the script, read here: https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php

 

var doc = app.activeDocument;
var label = "";

with (doc.documentPreferences) {
    label +=  "WxH: " + pageWidth + "x" + pageHeight;
}

var tf = app.selection[0];
tf.contents = label;

 

Votes

Translate

Translate
Community Expert ,
Aug 22, 2020 Aug 22, 2020

Copy link to clipboard

Copied

Can you define further what you mean by the trim area? Do you need the document's height and width, as well as the bleed? Or just the location of a placed PDF on an InDesign page? Do the documents have multiple pages, and are all page dimensions the same? This is how you would get the document dimensions and bleed settings into a document label, which you can then script to populate in a textframe called "Slug" (you can name Text Frames in your Layers palette). 

 

var doc = app.activeDocument;
var label = doc.label;

with (doc.documentPreferences) {
    label +=  "WxH: " + pageWidth + "x" + pageHeight + "\n";
    label += "Bleed (top, bottom, left, right): ";
    label += documentBleedTopOffset + ", ";
    label += documentBleedBottomOffset + ", ";
    label += documentBleedInsideOrLeftOffset + ", ";
    label += documentBleedOutsideOrRightOffset + "\n";
}

var tf = doc.textFrames.itemByName("Slug");
tf.contents = label;

 

There are, of course, ways to do this to all documents in a given folder, or all open docs, etc. 

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
New Here ,
Aug 24, 2020 Aug 24, 2020

Copy link to clipboard

Copied

Hello!

Yes, I need the document;s height and width without bleed. I do not need the location of the placed PDF. The PDFs only have one page. 

 

Also I am new to the whole scripting thing for Indesign. Soo...I have no clue what to do with the code that you included. Do you have a resource that can point me in the right direction ?

 

Thanks

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 ,
Aug 24, 2020 Aug 24, 2020

Copy link to clipboard

Copied

LATEST

Here's a more simplified version. Create a text frame and select it with your black arrow. Then run this script. To install the script, read here: https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-po...

 

var doc = app.activeDocument;
var label = "";

with (doc.documentPreferences) {
    label +=  "WxH: " + pageWidth + "x" + pageHeight;
}

var tf = app.selection[0];
tf.contents = label;

 

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