JavaScript Crop/Shift
Hello Everyone, I am scanning books. After scanning, i need to crop all the pages. I set up a series of buttons to move the crop box around after resetting the mediabox to [0,792,612,0].
I crop all the pages and when going through it's as if I never touched the pages.
I restore the page using this:
/* Restore Crop and Media Box to 8.5 x 11 */
this.setPageBoxes("Crop",this.pageNum,this.pageNum,[0,792,612 ,0]);
this.setPageBoxes("Media",this.pageNum,this.pageNum,[0,792,612 ,0]);
/* Crop from ALL sides */
var rCrop = this.getPageBox("Crop",this.pageNum);
rCrop[0] += 9; // Adjust Left Side
rCrop[1] -= 65; // Adjust Top Side
rCrop[2] -= 90; // Adjust Right Side
rCrop[3] -= 0; // Adjust Bottom Side
this.setPageBoxes("Crop",this.pageNum,this.pageNum,rCrop);
/* Shift */
var rCrop = this.getPageBox("Crop",this.pageNum);
rCrop[0] += 9; // Adjust Left Side
rCrop[1] -= 45; // Adjust Top Side
rCrop[2] += 9; // Adjust Right Side
rCrop[3] -= 45; // Adjust Bottom Side
this.setPageBoxes("Crop",this.pageNum,this.pageNum,rCrop);and then move or crop via buttons using the same code as above to either crop or shift but with different numbers.
Is there anything in there that I am missing that applies the changes to more than the page that is visible?
Thanks.
Patrick Brewer
