PdfToolCli is the command line tool that simply rotate and select pages in PDF documents, also this tool is able to merge multiple PDF files.
This is .NET Core tool.
Rotate all pages in target PDF document to specified angle.
$ pdftool rotate all <PdfFilePath> <Angle>
Argument | Description |
---|---|
PdfFilePath |
Target PDF file path. |
Angle |
Rotate right: 90, 180, 270. Rotate left: -90, -180, -270. |
Otion | Function |
---|---|
-o , --output |
Output file path that you want to save to. |
Rotate all pages to left 90° and save to 'output.pdf'.
$ pdftool rotate all MyPdf.pdf -90 -o output.pdf
Rotate specified pages in target PDF document to specified angle.
$ pdftool rotate pages <PdfFilePath> <pageNum1:angle1,pageNum2:angle2,...>
Argument | Description |
---|---|
PdfFilePath |
Target PDF file path. |
pageNum:angle |
Rotate 'pageNum'-th page to 'angle'°. |
Otion | Function |
---|---|
-o , --output |
Output file path that you want to save to. |
Rotate 1,2,5th page to right 180° and rotate 3rd page to left 90° and save to 'output.pdf'.
$ pdftool rotate pages MyPdf.pdf 1:180,2:180,3:-90,5:180 -o output.pdf
or
$ pdftool rotate pages MyPdf.pdf 1-2:180,3:-90,5:180 -o output.pdf
Select and save specified page in target PDF document.
$ pdftool select pages <PdfFilePath> <pageNum1,pageNum2,...>
Argument | Description |
---|---|
PdfFilePath |
Target PDF file path. |
pageNum |
Page number that you want to select. |
Otion | Function |
---|---|
-o , --output |
Output file path that you want to save to. |
Select 1,2,3,5th page and save to 'output.pdf'.
$ pdftool select pages MyPdf.pdf 1,2,3,5 -o output.pdf
or
$ pdftool select pages MyPdf.pdf 1-3,5 -o output.pdf
Show information about target PDF document.
$ pdftool info count <PdfFilePath>
Argument | Description |
---|---|
PdfFilePath |
Target PDF file path. |
No options.
Show page count of target PDF document.
$ pdftool info count MyPdf.pdf
result
'MyPdf.pdf' has 10 pages.
Merge multiple PDF files and save.
$ pdftool merge files <PdfFilePath1,PdfFilePath2,PdfFilePath3,...>
Argument | Description |
---|---|
List of PdfFilePath |
Comma separated list of target files you want to merge. |
Otion | Function |
---|---|
-o , --output |
Output file path that you want to save to. |
Merge 3 PDF files(MyPdf1.pdf, MyPdf2.pdf and MyPdf3.pdf) and save it to output.pdf.
$ pdftool merge files MyPdf1.pdf,MyPdf2.pdf,MyPdf3.pdf -o output.pdf