This repository is a collection of useful pdf tools.
- pdftk
- ghostscript
- qpdf
- pdf2dsc
- pdf2ps
- pdfdetach
- pdffonts
- pdfimages
- pdfinfo
- pdfseparate
- pdftocairo
- pdftohtml
- pdftoppm
- pdftops
- pdftotext
- pdfunite
docker pull gkmr/pdf-tools
mkdir pdf
Put PDF files in pdf directory.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools <command>
pdftk can combines, splits and rearranges PDF files.
merge pdf
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdftk /pdf/0.pdf /pdf/1.pdf cat output /pdf/merged.pdf
split pdf
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdftk /pdf/input.pdf cat 1-3 output /pdf/splitted.pdf
https://www.pdflabs.com/docs/pdftk-man-page/
ghostscript can convert image, embed font and outline, etc.
Convert to grayscale.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools gs -sOutputFile=/pdf/grayscale.pdf -sDEVICE=pdfwrite -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -dCompatibilityLevel=1.4 -dAutoRotatePages=/None -dBATCH /pdf/output.pdf
https://www.ghostscript.com/doc/current/Use.htm
qpdf does structural and content-preserving transformations on PDF files.
Password clear.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools qpdf --decrypt /pdf/encrypted.pdf --password=PASSWORD /pdf/decrypted.pdf
http://qpdf.sourceforge.net/files/qpdf-manual.html
pdf2dsc is generate a PostScript page list of a PDF document.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdf2dsc /pdf/input.pdf
https://linux.die.net/man/1/pdf2dsc
pdf2ps is Ghostscript PDF to PostScript translator.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdf2ps /pdf/input.pdf /pdf/output.ps
https://linux.die.net/man/1/pdf2ps
pdfdetach is document embedded file extractor.
Detach all embedded data.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdfdetach -saveall -o output /pdf/input.pdf
http://manpages.ubuntu.com/manpages/cosmic/man1/pdfdetach.1.html
pdffonts is font analyzer.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdffonts /pdf/foo.pdf
http://manpages.ubuntu.com/manpages/cosmic/man1/pdffonts.1.html
pdfimages is image extractor.
Convert JPEG images.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdfimages -j /pdf/input.pdf /pdf/output
http://manpages.ubuntu.com/manpages/cosmic/man1/pdfimages.1.html
pdfinfo is document information extractor.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdfinfo /pdf/foo.pdf
http://manpages.ubuntu.com/manpages/cosmic/man1/pdfinfo.1.html
pdfseparate is page extractor.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdfseparate /pdf/input.pdf /pdf/output_%d.pdf
http://manpages.ubuntu.com/manpages/cosmic/man1/pdfseparate.1.html
pdftocairo is to PNG/JPEG/TIFF/PDF/PS/EPS/SVG using cairo.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdftocairo -jpeg /pdf/input.pdf /pdf/output
http://manpages.ubuntu.com/manpages/cosmic/man1/pdftocairo.1.html
pdftohtml is to convert PDF files into HTML, XML and PNG images.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdftohtml /pdf/input.pdf /pdf/output
http://manpages.ubuntu.com/manpages/cosmic/man1/pdftohtml.1.html
pdftoppm is to Portable Pixmap converter.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdftoppm /pdf/input.pdf /pdf/output
http://manpages.ubuntu.com/manpages/cosmic/man1/pdftoppm.1.html
pdftops is to PostScript converter.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdftops /pdf/input.pdf /pdf/output.pdf
http://manpages.ubuntu.com/manpages/cosmic/man1/pdftops.1.html
pdftotext is to text converter.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdftotext /pdf/foo.pdf /pdf/foo.txt
http://manpages.ubuntu.com/manpages/cosmic/man1/pdftotext.1.html
pdfunite is PDF page merger.
docker run -v $PWD/pdf:/pdf gkmr/pdf-tools pdfunite /pdf/0.pdf /pdf/1.pdf /pdf/2.pdf /pdf/merged.pdf
http://manpages.ubuntu.com/manpages/cosmic/man1/pdfunite.1.html