I'm having three problems with the Doc.setPageBoxes() command.
The first problem:
problemCrop.pdf
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] })
It then expands the page:
image.png
If I then reset the page by running:
Code: Select all
this.setPageBoxes({ 'cBox': 'Media',
'nStart' : 0,
'rBox': [0,792,612,0] })
All appears good on the surface:
image(3).png
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:
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
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:
image(1).png
or
image(2).png
The third problem
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});
I get an error popup
image(4).png
You do not have the required permissions to view the files attached to this post.