Portable Document Format: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
 
(28 intermediate revisions by the same user not shown)
Line 1: Line 1:
__TOC__
A proprietary format owned by Adobe until 2008, when it was released and relicensed as an ISO standard.
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
http://en.wikipedia.org/wiki/Portable_Document_Format
== Readings==


* 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 & Postscript ==
 
* [https://computerhistory.org/blog/postscript-a-digital-printing-press/ Computer History Museum documented the history of postscript]
 
==PDF manipulating/editing tools==
 
[https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ pdftk] (the PDF toolkit)
 
[https://manpages.debian.org/stretch/poppler-utils/pdfimages.1.en.html pdfimages] (part of poppler-utils)
 
[https://manpages.debian.org/stretch/poppler-utils/pdfunite.1.en.html pdfunite] (part of poppler-utils)
 
[https://manpages.debian.org/stretch/poppler-utils/pdftotext.1.en.html pdftotext] (part of poppler-utils)


== Free software tools that work with PDF ==
$ pdftotext filename.pdf
Thanks to the [[Ghostscript]] project, there are many free software tools that work with postscript.
$ pdftotext -layout filename.pdf (Maintain (as best as possible) the original physical layout of the text.)


* pdftk
[https://manpages.debian.org/stretch/poppler-utils/pdfinfo.1.en.html pdfinfo] (part of poppler-utils)
* poppler
* [[Scribus]]
* [[Imagemagick]]


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


apt-get install poppler-utils
[https://manpages.debian.org/stretch/poppler-utils/pdffonts.1.en.html pdffonts] (part of poppler-utils)


pdftocairo -png mydoc.pdf
[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]


Creates a series of [[PNG]] files.
[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]


== Python tools to manipulate / generate PDF ==
[[resize.sh]] (using Ghostscript), via [http://osp.kitchen OSP]
* [http://xxyxyz.org/flat/ flat]
* [http://www.reportlab.com/opensource/ reportlab]
* [https://github.com/mstamy2/PyPDF2 pyPDF2]


== Examples ==
[[Imposition|imposition tools]] (multiple)
An example using reportlab (see http://stackoverflow.com/questions/2252726/how-to-create-pdf-files-in-python)
 
<source lang="python">
== F/LOSS tools to make PDFs ==
 
Thanks to the [[Ghostscript]] project, there are many free software tools that work with postscript and PDF.
 
The list below is transcluded from the [[Layout Tools]] page.
{{ :Typesetting_Tools }}
 
==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===
 
<syntaxhighlight lang="python">
from reportlab.pdfgen import canvas
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch, cm
from reportlab.lib.units import inch, cm
Line 36: Line 71:
c.showPage()
c.showPage()
c.save()
c.save()
</source>
</syntaxhighlight>
 
==See also==
 
* [[Imposition]] tools, to rearrange PDFs
* [[Typesetting Tools]]
* [[Web-to-print]]
* [[:Category:PagedMedia]]
* [[:Category:FLOSS design]]
 
[[Category:PagedMedia]]
[[Category:Cookbook]]

Latest revision as of 17:04, 1 March 2024


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 & 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.

The list below is transcluded from the Layout Tools page.

Canvas based (GUI)

CSS Print based (CSS Print)

P5.js based

Python based

TeX based

XML 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()

See also