Highlighted

Text Variable for PDF Trim Box

New Here ,
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. 

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

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;

 

TOPICS
How to, Scripting

Views

70

Likes

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

Text Variable for PDF Trim Box

New Here ,
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. 

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

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;

 

TOPICS
How to, Scripting

Views

71

Likes

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
Aug 22, 2020 0
Adobe Community Professional ,
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. 

Likes

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
Reply
Loading...
Aug 22, 2020 0
New Here ,
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

Likes

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
Reply
Loading...
Aug 24, 2020 0
Adobe Community Professional ,
Aug 24, 2020

Copy link to clipboard

Copied

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;

 

Likes

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
Reply
Loading...
Aug 24, 2020 0