Skip to main content
Known Participant
October 27, 2020
Question

Need a script for acrobat for free/nominal fee - to change height in document

  • October 27, 2020
  • 2 replies
  • 2072 views

Every document I run the script, the height changes to 35 cm and the width remains the same.

For example:
I have a document size 10 width by 21 height, I want to change the height to 35.
The media size, not the crop size.
another example:
Document size 15 width by 20 height, I want to change the height to 35.

 

The script will be inside the menu in Acrobat.

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
October 28, 2020

You can use this code to do it:

 

var pageBox = this.getPageBox("Media", this.pageNum);
var pageWidth = pageBox[1]-pageBox[3];
var newPageBox = [0, pageWidth, 35*28.3465, 0];
this.setPageBoxes("Media", this.pageNum, this.pageNum, newPageBox);
aviel222Author
Known Participant
October 28, 2020
Hey

Thank you!!



I put it in the "Java Scripts" folder

Of Acrobat

But I do not see it appearing

You can please arrange for it to appear under a menu

"file"?
Thom Parker
Community Expert
Community Expert
October 29, 2020

Okay, friends, thanks, but keep in mind I'm not a programmer
And do not understand it so much.
I'm happy if someone corrects my code and sends me something perfect,
With a change in media (below the code) and menu.
Thanks!!!!!!!!


You'll find a free page resizeing tool here:

https://www.pdfscripting.com/public/Free_Acrobat_Automation_Tools.cfm

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
BarlaeDC
Community Expert
Community Expert
October 27, 2020

Hi,

When you say you want the height changed, are you wanting the contents of the page to change?

 

Regards

 

Malcolm

aviel222Author
Known Participant
October 27, 2020

No.

Only to add white up and down