Jump to content

Cropping Javascript Code Not Working


alienA2
 Share

Recommended Posts

Hello. This is a piece of coding I am busy with. My intention is crop an entire PDF document. But somehow did does not work. Please note that this is Acrobat Javascript for Acrobat Professional. Any advice? Thanks (method behind the madness:Subtract the the correct height (265) from the current height (315.85), then take the final value and divide it by 2. Then take those values and add it to the top and bottom of cropbox. Subtract the the correct width (220) from the current width (420.54), then take the final value and divide it by 2. Then take those values and add it to the left and right of cropbox.) code: for(var i=0 ; i<this.numPages; i+=1){var width = 220;var height = 265; var desired_width = ((getPageBox("Crop",0)[1]) - width) / 2;var desired_height = ((getPageBox("Crop",0)[2]) - height) / 2; this.setPageBoxes("Crop",0,0 [desired_height , desired_height, desired_width, desired_width]);}

Edited by alienA2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...