Skip to main content
Known Participant
October 26, 2020
Answered

Height change only in the document

  • October 26, 2020
  • 1 reply
  • 1465 views

Hey
I have a document in varying sizes.
I am looking for a  script to change its height to a certain size
(Do not reduce or increase, but only add white on both sides in height)

This topic has been closed for replies.
Correct answer ls_rbls
In conclusion

I still prefer a simple script

To be in the file menu

If anything can make me one I would greatly appreciate it.

I don't think you can have that option in the File Menu, that would be more geared toward developing your own plug-ins, but you can use the Action Wizard to perform batch actions like this one or a Mouse-Up action with a button in the PDF.

 

I would say, to refer to this discussion in which ACP Thom Parker provides valuable links to some of his fine tutorials in regards of media box versus crop box:

 

 

Below is more in-depth tutorial about what you're asking:

 

 

 

1 reply

ls_rbls
Community Expert
Community Expert
October 26, 2020

I think you can achieve that by setting a page size. 

 

If you're on windows see slides: 

 

 

 

 

 

 

 

But if you're looking for a script, below are two different cases that I used trying to help another user in the forums a while ago.

 

In the example below I was using this script with the Action Wizard tool, not from a button, but you can also use it with a button Mouse-Up action. I am not sure who this original script belongs to for the proper credit (maybe Thom Parker).

 

/* Put script title here */
var rCrop = this.getPageBox("Crop",this.pageNum); 
rCrop[0] += 8.5; // Adjust Left Side 
rCrop[1] -= 5.7; // Adjust Top Side 
rCrop[2] -= 0; // Adjust Right Side 
rCrop[3] += 0; // Adjust Bottom Side 
this.setPageBoxes("Crop",this.pageNum,this.pageNum,rCrop);

var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.manual;
pp.printerName = "Epson L805 Series";
this.print({bUI: true, nStart: this.pageNum})

 

 

Here's another case example that I've used with the guidance of some examples found in the Adobe Acrobat API Reference:

 

var pp = this.getPrintParams();
//pp.firstPage = 0;
//pp.lastPage = 24;
pp.interactive = pp.constants.interactionLevel.automatic;
pp.DuplexType = pp.constants.duplexTypes.DuplexFlipLongEdge;
pp.pageHandling = pp.constants.handling.fit;
pp.printerName = "Adobe PDF";
//if (this.getField("CH.6").value == "Yes") {this.print(false, 11,16)};
//this.print(pp);
if (this.getField("CH.6").value == "Yes") {this.print({bUI: false, nStart: 11, nEnd: 16,})};

 

aviel222Author
Known Participant
October 26, 2020

Hi thank you very much first of all.
This is not exactly what I meant.
I meant it:
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.

Bernd Alheit
Community Expert
Community Expert
October 26, 2020

In Acrobat Pro use the crop tool for this.