Copy link to clipboard
Copied
Hello all,
I have a document of around 800 pages that is been made by importing PDF pages.
Unfortunately, the document has been set up in the wrong format (A4 instead of Letter size), so I have changed the document dimensions using Adjust Layout and the used this script to fit the content of the image into the newly adjusted frame:
app.activeDocument.rectangles.everyItem().fit(FitOptions.CONTENT_TO_FRAME);
The problem I am experiecing is that each PDF has a border aroud it which I would like to cut, so I would now like to resize the frame of a couple mm to cut the border. Is there a script I can use to achieve that?
Happy to run one script to do all of it (resizing and cutting) or to run two separate ones.
Thank you!
Copy link to clipboard
Copied
Did the frame have an object style? If so, the size and position of the object style could be changed.
If not, are the PDF pages imported from one document or many? If it is one 800pp PDF placed into ID, you could use the multipageimporter script to import all pages at once on its own layer and to an appropriate scale. The script is here: https://github.com/mike-edel/ID-MultiPageImporter/releases
Copy link to clipboard
Copied
Hi @Francesco23262834dw7e , Try this:
var v = 2;//the amount in points to crop
app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS;
var lnks = app.activeDocument.links.everyItem().getElements();
var f, b;
for (var i = 0; i < lnks.length; i++){
f= lnks[i].parent.parent;
f.fit(FitOptions.FRAME_TO_CONTENT)
b = f.geometricBounds;
f.geometricBounds = [b[0]+v, b[1]+v, b[2]-v, b[3]-v];
};
app.scriptPreferences.measurementUnit = AutoEnum.AUTO_VALUE;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now