Usage

Use pdfcpu for a rundown of all commands:

  1. pdfcpu is a tool for PDF manipulation written in Go.
  2. Usage:
  3. pdfcpu command [arguments]
  4. The commands are:
  5. attachments list, add, remove, extract embedded file attachments
  6. changeopw change owner password
  7. changeupw change user password
  8. decrypt remove password protection
  9. encrypt set password protection
  10. extract extract images, fonts, content, pages, metadata
  11. grid rearrange pages/images into grid page layout for enhanced browsing experience
  12. import convert/import images to PDF
  13. merge concatenate 2 or more PDFs
  14. nup rearrange pages/images into grid page layout for reduced number of pages
  15. optimize optimize PDF by getting rid of redundant page resources
  16. pages insert, remove pages
  17. paper print list of supported paper sizes
  18. permissions list, add user access permissions
  19. rotate rotate pages
  20. split split multi-page PDF into several PDFs according to split span
  21. stamp add stamps
  22. trim create trimmed version
  23. validate validate PDF against PDF 32000-1:2008 (PDF 1.7)
  24. version print version
  25. watermark add watermarks
  26. Completion supported for all commands.
  27. One letter Unix style abbreviations supported for flags.
  28. Use "pdfcpu help [command]" for more information about a command.

Core Commands

Choose on of the basic processing features:

  1. pdfcpu validate [-verbose] [-mode strict|relaxed] [-upw userpw] [-opw ownerpw] inFile
  2. pdfcpu optimize [-verbose] [-stats csvFile] [-upw userpw] [-opw ownerpw] inFile [outFile]
  3. pdfcpu merge [-verbose] outFile inFile...
  4. pdfcpu split [-verbose] [-upw userpw] [-opw ownerpw] inFile outDir [span]
  5. pdfcpu trim [-verbose] -pages pageSelection [-upw userpw] [-opw ownerpw] inFile outFile
  6. pdfcpu rotate [-v(erbose)|vv] [-pages pageSelection] inFile rotation
  7. pdfcpu stamp [-verbose] -pages pageSelection description inFile [outFile]
  8. pdfcpu watermark [-verbose] -pages pageSelection description inFile [outFile]
  9. pdfcpu nup [-v(erbose)|vv] [-pages pageSelection] [description] outFile n inFile|imageFiles...
  10. pdfcpu grid [-v(erbose)|vv] [-pages pageSelection] [description] outFile m n inFile|imageFiles...

Generate Commands

Convert images (jpg, png, tiff) into PDF:

  1. pdfcpu import [-v(erbose)|vv] [description] outFile imageFile...

Pages

Insert and remove pages:

  1. pdfcpu pages insert [-v(erbose)|vv] [-pages pageSelection] [-upw userpw] [-opw ownerpw] inFile [outFile]
  2. pdfcpu pages remove [-v(erbose)|vv] -pages pageSelection [-upw userpw] [-opw ownerpw] inFile [outFile]

Extraction

Extract components and resources:

  1. pdfcpu extract [-verbose] -mode image|font|content|page|meta [-pages pageSelection] [-upw userpw] [-opw ownerpw] inFile outDir

Attachments

Manage your PDF attachments:

  1. pdfcpu attachments list [-verbose] [-upw userpw] [-opw ownerpw] inFile
  2. pdfcpu attachments add [-verbose] [-upw userpw] [-opw ownerpw] inFile file...
  3. pdfcpu attachments remove [-verbose] [-upw userpw] [-opw ownerpw] inFile [file...]
  4. pdfcpu attachments extract [-verbose] [-upw userpw] [-opw ownerpw] inFile outDir [file...]

Encryption

Secure your PDFs:

  1. pdfcpu encrypt [-verbose] [-mode rc4|aes] [-key 40|128|256] [-perm none|all] [-upw userpw] -opw ownerpw inFile [outFile]
  2. pdfcpu decrypt [-verbose] [-upw userpw] [-opw ownerpw] inFile [outFile]
  3. pdfcpu changeopw [-verbose] [-upw userpw] inFile opwOld opwNew
  4. pdfcpu changeupw [-verbose] [-opw ownerpw] inFile upwOld upwNew
  5. pdfcpu permissions add [-verbose] [-perm none|all] [-upw userpw] -opw ownerpw inFile
  6. pdfcpu permissions list [-verbose] [-upw userpw] [-opw ownerpw] inFile

Other

Print Supported Papersizes

  1. pdfcpu paper

Print Version

  1. pdfcpu version