PDF to PDF / Command Line Examples
This page contains various examples of using the PDF to PDF API in Command Line. The examples are complete and fully functional. Read more about how to convert PDF to PDF in Command Line.
Basic examples
    
        
                PDF manipulation examples
        
        - Extract page 3 and all pages from 7 to the end from the PDF file
 - Delete the first 3 pages and the 10th page from the PDF file
 
Basic examples
Multiple PDFs to PDF file
pdf2pdf -user-name "demo" -api-key "demo" \ /path/to/cover.pdf \ /path/to/proposal.pdf \ /path/to/price.pdf \ /path/to/contact.pdf > "offer.pdf"
Watermark a PDF file
pdf2pdf -user-name "demo" -api-key "demo" \ -page-watermark "/path/to/watermark.pdf" \ /path/to/proposal.pdf > "company_offer.pdf"
Linearize a PDF file
pdf2pdf -user-name "demo" -api-key "demo" \ -linearize \ /path/to/not_linearized.pdf > "linearized.pdf"
PDF manipulation examples
Extract page 3 and all pages from 7 to the end from the PDF file
pdf2pdf -user-name "demo" -api-key "demo" \ -action "extract" \ -page-range "3,7-" \ /your-path-to/pdfs/13_pages.pdf > "output.pdf"
Delete the first 3 pages and the 10th page from the PDF file
pdf2pdf -user-name "demo" -api-key "demo" \ -action "delete" \ -page-range "1-3,10" \ /your-path-to/pdfs/13_pages.pdf > "output.pdf"