Set pdf page content size using command line

Most Often, you are asked to set more than one formats of pdf files, it is comprehensive ones, for example, you will set pdf page content and  page size, which means that you have to edit pdf page content and pdf page size synthetically. You just work hard, it is not far enough, importantly, you must possess a useful tool to set pdf files to assist you. However an average one will not be competent, surely the VeryPDF.com has already tailored for you---Advanced PDF Tools Command Line.

Following the below steps, you will not only possess this useful tool but also know how to use it within minutes.

Step 1 click the following link to download Advanced PDF Tools

http://www.verypdf.com/pdfinfoeditor/advanced_pdf_tools_cmd.zip

please unpack it when download is finished.

Step 2 launch the MS-DOS command prompt window. Because the command line is bound to be operated under the MS-DOS environment. The procedure is easy, and the following pictures will guide you.

1) click “start” and then go to “Run”

Snap100

Snap101

2) input cmd into the following ,do as the picture indicates

Snap57

3) press “ok”, you will find MS-DOS command prompt window popping up

Snap1

Step 3 input command lines to set pdf page content size

  1. Edit page size—pdftools -i “C:\input.pdf” -o “C:\output.pdf” -x “llx lly urx ury”

where the parameter “llx lly urx ury” is a form of rectangles, which is described in remark one

2.  Edit page content—pdftools -i “C:\input.pdf” -o “C:\output.pdf” -j “60% 70% true”

where the first parameter means to set page content to 60% of the page width and the second parameter to 70% of the page height, and the third parameter is a Boolean type value to set whether to center on page. 

Remark One: Rectangle Description
Rectangles are used to describe locations on a page and bounding boxes for a variety of objects, such as fonts. A rectangle is written as an array of four numbers giving the coordinates of a pair of diagonally opposite corners. Typically, the array takes the form [llx lly urx ury] specifying the lower-left x, lower-left y, upper-right x, and upper-right y coordinates of the rectangle, in that order. The other two corners of the rectangle are
then assumed to have coordinates (llx, ury) and (urx, lly).

Remark Two:
Usually there are three size unit such as point (pt), inch (in), millimeter (mm). Point size can be converted to inch like point/72=inch, and point to millimeter like point/72*25.4=millimeter. For example, the 595.5pt can be 8.27in or 210.06mm by calculating as:

595.5/72=8.27
595.5/72*25.4=210.06
Remark Three: if urx (Width) or ury (Height) equal zero, the value of urx (Width) or ury (Height)  will be calculated automatically, maintain their original aspect ratio,
eg.
pdftools.exe -i C:\in.pdf -o C:\out.pdf -x “0 0 612 792″ -j “612 792 true”
pdftools.exe -i C:\in.pdf -o C:\out.pdf -x “0 0 612 0” -j “612 0 true”       //ury (Height) will be calculated automatically
pdftools.exe -i C:\in.pdf -o C:\out.pdf -x “0 0 0 792″ -j “0 792 true”       //urx (Width) will be calculated automatically

so combine them , they can be written as follow

pdftools -i “C:\input.pdf” -o “C:\output.pdf” -x “0 0 595.5 842.25″  -j “595.5 842.25 true”    

once you finish your input, press “enter” key, and you will see

Snap156

Step 4 open the file to check the result, to demonstrate the perfect sound, the VeryPDF.com makes a comparison below

Snap159

                                                          Picture (1) 

Snap158

                                                 Picture (2)

Snap160

                                                         Picture (3)

The picture (1) shows the pdf page content size before editing while picture (2) after editing and Picture (3)  a zooming one.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in Advanced PDF Tools and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!