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

How do I adjust the image to fit the entire page, including bleed?

Guide ,
Jul 29, 2025 Jul 29, 2025

It seems that exceeding the geometricBounds has no effect.
I tested this:

var sel = app.documents[0].selection;
var pb = sel[j].parentPage.bounds;
sel[j].geometricBounds = [-10, -10, pb[2], pb[3]]


and found it to be very wrong.

TOPICS
How to , Scripting
210
Translate
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 , Jul 29, 2025 Jul 29, 2025

In addition to Rob's note, it could be that your document offset is not exactly 0 or your units are off. You can do something like this instead (from chat gpt... seems good)

 

// Resize selected rectangle to page size including bleed
if (app.documents.length > 0 && app.selection.length === 1 && app.selection[0] instanceof Rectangle) {
var doc = app.activeDocument;
var page = app.selection[0].parentPage;

if (page == null) {
alert("The selected rectangle is not on a page.");
} else {
// Get bleed values

...
Translate
Community Expert ,
Jul 29, 2025 Jul 29, 2025

the geometricBounds has no effect.

 

What  is [j] ?

 

Screen Shot 24.png

 

Translate
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 ,
Jul 29, 2025 Jul 29, 2025

In addition to Rob's note, it could be that your document offset is not exactly 0 or your units are off. You can do something like this instead (from chat gpt... seems good)

 

// Resize selected rectangle to page size including bleed
if (app.documents.length > 0 && app.selection.length === 1 && app.selection[0] instanceof Rectangle) {
var doc = app.activeDocument;
var page = app.selection[0].parentPage;

if (page == null) {
alert("The selected rectangle is not on a page.");
} else {
// Get bleed values from document
var bleed = doc.documentPreferences;
var bleedTop = bleed.documentBleedTopOffset;
var bleedBottom = bleed.documentBleedBottomOffset;
var bleedInside = bleed.documentBleedInsideOrLeftOffset;
var bleedOutside = bleed.documentBleedOutsideOrRightOffset;

// Get page bounds [y1, x1, y2, x2] in points
var pageBounds = page.bounds;

// Calculate new bounds including bleed
var newY1 = pageBounds[0] - bleedTop;
var newX1 = pageBounds[1] - bleedInside;
var newY2 = pageBounds[2] + bleedBottom;
var newX2 = pageBounds[3] + bleedOutside;

// Resize the selected rectangle
var rect = app.selection[0];
rect.geometricBounds = [newY1, newX1, newY2, newX2];
}
} else {
alert("Please select a single rectangle on a page.");
}

Translate
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
Guide ,
Jul 29, 2025 Jul 29, 2025

Hi brian_p_dts.
There is a lot of useful information here. I will study it.

Thank you very much.

Translate
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
Guide ,
Aug 02, 2025 Aug 02, 2025
LATEST

Not correct on the right page

Translate
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