Skip to content

Latest commit

 

History

History
105 lines (69 loc) · 1.52 KB

File metadata and controls

105 lines (69 loc) · 1.52 KB

PDF

PDFly

Utility to extract metadata, cut, splice or concatenate PDFs.

https://pdfly.readthedocs.io/en/latest/

brew install pdfly

Extract Metadata

pdfly meta "$name.pdf"

Extract Pages from a PDF

Works like Python list - indices start at zero.

This takes pages 2, 3 and 4 into out.pdf:

pdfly cat input.pdf 1:4 -o out.pdf

Extract the 5th page:

pdfly cat input.pdf 5 -o out.pdf

Concatenate PDFs together

pdfly cat input1.pdf input2.pdf -o out.pdf

Convert Image to PDF

pdfly x2pdf image.jpg -o out.pdf

Convert Text file to PDF

Pandoc

brew install pandoc
pandoc "$name.txt" -o "$name.pdf"

enscript + ps2pdf

brew install enscript ghostscript
enscript "$name.txt" -o - | ps2pdf - "$name.pdf"

textutil

Built in to macOS, but limited styling:

textutil -convert pdf "$name.txt" -output "$name.pdf"