2019-12-31 01:18:28 +00:00
|
|
|
# cpdf
|
|
|
|
|
|
|
|
> CLI to manipulate existing PDF files in a variety of ways.
|
2020-01-01 02:14:03 +00:00
|
|
|
> More information: <https://www.coherentpdf.com/cpdfmanual/cpdfmanual.html>.
|
2019-12-31 01:18:28 +00:00
|
|
|
|
2020-01-01 02:14:03 +00:00
|
|
|
- Select pages 1, 2, 3 and 6 from a source document and write those to a destination document:
|
2019-12-31 01:18:28 +00:00
|
|
|
|
2020-01-01 02:14:03 +00:00
|
|
|
`cpdf {{path/to/source_document.pdf}} {{1-3,6}} -o {{path/to/destination_document.pdf}}`
|
2019-12-31 01:18:28 +00:00
|
|
|
|
|
|
|
- Merge two documents into a new one:
|
|
|
|
|
|
|
|
`cpdf -merge {{path/to/source_document_one.pdf}} {{path/to/source_document_two.pdf}} -o {{path/to/destination_document.pdf}}`
|
|
|
|
|
|
|
|
- Show the bookmarks of a document:
|
|
|
|
|
|
|
|
`cpdf -list-bookmarks {{path/to/document.pdf}}`
|
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Split a document into ten-page chunks, writing them to `chunk001.pdf`, `chunk002.pdf`, etc:
|
2019-12-31 01:18:28 +00:00
|
|
|
|
2020-01-01 02:14:03 +00:00
|
|
|
`cpdf -split {{path/to/document.pdf}} -o {{path/to/chunk%%%.pdf}} -chunk {{10}}`
|
2019-12-31 01:18:28 +00:00
|
|
|
|
|
|
|
- Encrypt a document using 128bit encryption, providing `fred` as owner password and `joe` as user password:
|
|
|
|
|
2020-01-01 02:14:03 +00:00
|
|
|
`cpdf -encrypt {{128bit}} {{fred}} {{joe}} {{path/to/source_document.pdf}} -o {{path/to/encrypted_document.pdf}}`
|
2019-12-31 01:18:28 +00:00
|
|
|
|
|
|
|
- Decrypt a document using the owner password `fred`:
|
|
|
|
|
2020-01-01 02:14:03 +00:00
|
|
|
`cpdf -decrypt {{path/to/encrypted_document.pdf}} owner={{fred}} -o {{path/to/decrypted_document.pdf}}`
|
2019-12-31 01:18:28 +00:00
|
|
|
|
|
|
|
- Show the annotations of a document:
|
|
|
|
|
|
|
|
`cpdf -list-annotations {{path/to/document.pdf}}`
|
|
|
|
|
2020-01-01 02:14:03 +00:00
|
|
|
- Create a new document from an existing one with additional metadata:
|
2019-12-31 01:18:28 +00:00
|
|
|
|
|
|
|
`cpdf -set-metadata {{path/to/metadata.xml}} {{path/to/source_document.pdf}} -o {{path/to/destination_document.pdf}}`
|