Portable Document Format: Difference between revisions

From XPUB & Lens-Based wiki
Line 66: Line 66:
===Python===
===Python===


* rinohtype (http://www.mos6581.org/rinohtype/master/)
* [[ReportLab]] https://www.reportlab.com/
* [[ReportLab]] https://www.reportlab.com/
* Flat http://xxyxyz.org/flat/  
* Flat http://xxyxyz.org/flat/  
Line 77: Line 78:
===Misc===
===Misc===


* groff (https://www.gnu.org/software/groff/)
* SILE (https://sile-typesetter.org/)
* [[Imagemagick]] https://imagemagick.org/
* [[Imagemagick]] https://imagemagick.org/



Revision as of 17:28, 8 December 2023


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

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

Readings

PDF, Ghostscript, 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

imposition tools (multiple)

F/LOSS tools to make PDFs

Thanks to the Ghostscript project, there are many free software tools that work with postscript and PDF.

Canvas based (GUI)

Web based (web-to-print)

Python

LaTeX based

Misc

Examples

Pandoc

$ pandoc -f markdown --pdf-engine weasyprint -c stylesheet.css filename.md -o filename.pdf

Weasyprint

$ weasyprint -s stylesheet.css filename.html filename.pdf

ReportLab

from reportlab.pdfgen import canvas
from reportlab.lib.units import inch, cm
c = canvas.Canvas('ex.pdf')
c.drawImage('ar.jpg', 0, 0, 10*cm, 10*cm)
c.showPage()
c.save()