[javascript] Doc.setPageBoxes() weird behavior?
Posted: Sat Jan 18, 2025 3:30 am
I'm having three problems with the Doc.setPageBoxes() command.
The first problem: For the attached pdf file, I can expand the media box by running:
It then expands the page:
If I then reset the page by running:
All appears good on the surface:
However, if I try to run the first command again, nothing happens! The undo history says a crop has happened, but I cannot find any changes. At this point, I can't figure out what's messed up in the page boxes. If I run 'Normalize Pages' for instance, it thinks they're already "normalized". Art, Bleed, BBox, Trim, Crop all seem to have the same values that they did originally:
The second problem is how javascript is responding to errors with the parameters in this method. Instead of returning a javascript error, it's popping up a dialog which makes handling any error impossible:
or
The third problem
API states that the parameter rBox is optional. If not provided, the specified box is removed.
However, if I try
I get an error popup
The first problem: For the attached pdf file, I can expand the media box by running:
Code: Select all
this.setPageBoxes({ 'cBox': 'Media',
'nStart' : 0,
'rBox': [-187.0426025390625,792,791.093505859375,0] })
Code: Select all
this.setPageBoxes({ 'cBox': 'Media',
'nStart' : 0,
'rBox': [0,792,612,0] })
Code: Select all
Art: 0,792,612,0
Bleed: 0,792,612,0
BBox: 67.46399688720703,753.8079833984375,565.0999755859375,27.7340087890625
Trim: 0,792,612,0
Crop: 0,792,612,0
API states that the parameter rBox is optional. If not provided, the specified box is removed.
However, if I try
Code: Select all
doc.setPageBoxes({ 'cBox': 'Trim', 'nStart':0});