When handling PDF files in batch, you may meet some skew ones which are hard to be processed further. In this article, I will show you how to rotate PDF in batch by command line. I use tool named VeryPDF PDF Toolbox, which can also be used to merge, split, encrypt, fill PDF form, edit PDF description information, and optimize PDF.
Some information about software PDF Toolbox
PDF Toolbox Command Line can work in three platforms: Mac, Linux and Windows. And it is command line version application, which can be called together with other applications like VB, C#, VB.NET, ASP.NET, Delphi, C/C++, ASP, PHP, etc. There is also PDF Parse & Modify Component for .NET is a development component for Windows .NET developers. By this version, you can analyze and extract the text information in PDF and rebuild a PDF to a HTML page.
Step 1. Download PDF Toolbox
- When downloading finishes, there will be an zip file. Please extract it to some folder then you can check elements in it.
- When use this software, please refer to the usage and examples.
Step 2. Rotate PDF by command line
Usage:pdftoolbox <input files> [options] <-outfile output >
When you need to rotate PDF, please refer to the following command line template.
Rotate the first PDF page to 90 degrees clockwise
pdftoolbox sample_in1.pdf -merge 1E 2-end -outfile _rotate_first_page_90_out.pdf
Rotate an entire PDF document to 180 degrees
pdftoolbox sample_in1.pdf -merge 1-endS -outfile _rotate_all_pages_180_out.pdf
Rotate entire document 90 degrees
pdftoolbox sample_in1.pdf -merge 1-endE -outfile _rotate_all_pages_90_out.pdf
-merge : merge multiple PDF files into one PDF file. You can use handles and handle arguments to specify page ranges, rotate pages, change order when merge PDF.
E : rotate 90 degrees, e.g., A4-9E is to rotate the pages 4-9 of file A by 90 degrees.
S : rotate 180 degrees.
W : rotate 270 degrees.
N : rotate 0 degree.
L : rotate counterclockwise.
R : rotate clockwise.
By those parameters, you can rotate PDF in 90, 180, 270 degrees. Now let us check the rotate effect from the following snapshot.
When you need to rotate PDF in batch, please write bat file for use wild character. For example:
pdftoolbox *.pdf -merge 1E 2-end -outfile combined.pdf
There are too many functions of this software, I can not list all of them here. Please check more in the readme.txt or website. During the using, if you have any question, please contact us as soon as possible.