Portable Document Format: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
 
(34 intermediate revisions by the same user not shown)
Line 2: Line 2:




A proprietary format owned by Adobe until 2008, when it was released and relicensed as an ISO standard.
A proprietary format launched in 1992, owned by Adobe until 2008, after which it was released and relicensed as an ISO standard.


http://en.wikipedia.org/wiki/Portable_Document_Format
http://en.wikipedia.org/wiki/Portable_Document_Format
Line 9: Line 9:


* https://www.vice.com/en/article/pam43n/why-the-pdf-is-secretly-the-worlds-most-important-file-format
* https://www.vice.com/en/article/pam43n/why-the-pdf-is-secretly-the-worlds-most-important-file-format
* https://planetpdf.com/planetpdf/pdfs/warnock_camelot.pdf
* [https://web.archive.org/web/20160527105336/http://www.planetpdf.com/planetpdf/pdfs/warnock_camelot.pdf https://planetpdf.com/planetpdf/pdfs/warnock_camelot.pdf]


== PDF, Ghostscript, Postscript ==
== PDF & Postscript ==


...
* [https://computerhistory.org/blog/postscript-a-digital-printing-press/ Computer History Museum documented the history of postscript]


== F/LOSS tools to make PDFs ==
==PDF manipulating/editing tools==
 
Thanks to the [[Ghostscript]] project, there are many free software tools that work with postscript and PDF.
 
===Canvas based (GUI)===
 
* [[Scribus]] https://www.scribus.net/
* Laidout https://laidout.org/
* Inkscape https://inkscape.org/


===Web based (web-to-print)===
[https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ pdftk] (the PDF toolkit)  


* your browser (use CTRL+P or CMD+P)
[https://manpages.debian.org/stretch/poppler-utils/pdfimages.1.en.html pdfimages] (part of poppler-utils)
* Weasyprint https://weasyprint.readthedocs.io/
* Paged.js https://www.pagedjs.org/
* wkhtmltopdf https://wkhtmltopdf.org/


===Python===
[https://manpages.debian.org/stretch/poppler-utils/pdfunite.1.en.html pdfunite] (part of poppler-utils)


* Reportlab https://www.reportlab.com/
[https://manpages.debian.org/stretch/poppler-utils/pdftotext.1.en.html pdftotext] (part of poppler-utils)
* Flat http://xxyxyz.org/flat/
* pyPDF2 https://github.com/mstamy2/PyPDF2


===LaTeX based===
$ pdftotext filename.pdf
$ pdftotext -layout filename.pdf (Maintain (as best as possible) the original physical layout of the text.)


* LaTeX https://www.latex-project.org/
[https://manpages.debian.org/stretch/poppler-utils/pdfinfo.1.en.html pdfinfo] (part of poppler-utils)
* ConTeXt  https://wiki.contextgarden.net/Main_Page


===Misc===
$ pdfinfo filename.pdf
$ pdfinfo -meta filename.pdf (print metadata)
$ pdfinfo -url filename.pdf (print all urls)
$ pdfinfo -dests filename.pdf (print all internal links)


* [[Imagemagick]]
[https://manpages.debian.org/stretch/poppler-utils/pdffonts.1.en.html pdffonts] (part of poppler-utils)
 
==PDF manipulating/editing tools==


* pdftk (the PDF toolkit) https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
[http://osp.kitchen/tools/pdfutils/tree/master/rgb2cmyk.sh#project-detail-files rgb2cmyk.sh] (using Ghostscript), part of [http://osp.kitchen/tools/pdfutils/ OSP's pdfutils]
* pdfimages (part of poppler-utils) https://manpages.debian.org/stretch/poppler-utils/pdfimages.1.en.html
* pdfunite (part of poppler-utils) https://manpages.debian.org/stretch/poppler-utils/pdfunite.1.en.html
* pdftotext (part of poppler-utils) https://manpages.debian.org/stretch/poppler-utils/pdftotext.1.en.html
* pdfinfo (part of poppler-utils) https://manpages.debian.org/stretch/poppler-utils/pdfinfo.1.en.html
* pdffonts (part of poppler-utils) https://manpages.debian.org/stretch/poppler-utils/pdffonts.1.en.html


==Examples==
[http://osp.kitchen/tools/pdfutils/tree/master/colorSeparation.sh#project-detail-files coloseperation.sh] (using Ghostscript), part of [http://osp.kitchen/tools/pdfutils/ OSP's pdfutils]


===One-liners===
[[resize.sh]] (using Ghostscript), via [http://osp.kitchen OSP]


$ pandoc -f markdown --pdf-engine weasyprint -c stylesheet.css filename.md -o filename.pdf
[https://github.com/24eme/signaturepdf Signature PDF] (web GUI for pdf signing, editing, combining, compression)


$ weasyprint -s stylesheet.css filename.html filename.pdf
[[Imposition|imposition tools]] (multiple)


===Reportlab===
==See also==


<syntaxhighlight lang="python">
* [[How to PDF]]
from reportlab.pdfgen import canvas
* [[Imposition]] tools, to rearrange PDFs
from reportlab.lib.units import inch, cm
* [[Typesetting Tools]]
c = canvas.Canvas('ex.pdf')
* [[CSS Print]]
c.drawImage('ar.jpg', 0, 0, 10*cm, 10*cm)
* [[:Category:PagedMedia]]
c.showPage()
* [[:Category:FLOSS design]]
c.save()
</syntaxhighlight>


[[Category:PagedMedia]]
[[Category:PagedMedia]]
[[Category:Cookbook]]
[[Category:Cookbook]]

Latest revision as of 11:34, 8 July 2026


A proprietary format launched in 1992, owned by Adobe until 2008, after which it was released and relicensed as an ISO standard.

http://en.wikipedia.org/wiki/Portable_Document_Format

Readings

PDF & Postscript

PDF manipulating/editing tools

pdftk (the PDF toolkit)

pdfimages (part of poppler-utils)

pdfunite (part of poppler-utils)

pdftotext (part of poppler-utils)

$ pdftotext filename.pdf
$ pdftotext -layout filename.pdf (Maintain (as best as possible) the original physical layout of the text.)

pdfinfo (part of poppler-utils)

$ pdfinfo filename.pdf
$ pdfinfo -meta filename.pdf (print metadata)
$ pdfinfo -url filename.pdf (print all urls)
$ pdfinfo -dests filename.pdf (print all internal links)

pdffonts (part of poppler-utils)

rgb2cmyk.sh (using Ghostscript), part of OSP's pdfutils

coloseperation.sh (using Ghostscript), part of OSP's pdfutils

resize.sh (using Ghostscript), via OSP

Signature PDF (web GUI for pdf signing, editing, combining, compression)

imposition tools (multiple)

See also