Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Und dann kann man das als PDF runterladen...
Search
Andreas Heigl
February 24, 2014
Technology
0
41
Und dann kann man das als PDF runterladen...
The state of PDF-creation libraries in PHP (date 2014)...
Andreas Heigl
February 24, 2014
Tweet
Share
More Decks by Andreas Heigl
See All by Andreas Heigl
Gitlab - an introduction
heiglandreas
0
43
Schei� encoding
heiglandreas
0
71
Aus alt mach neu
heiglandreas
0
25
Other Decks in Technology
See All in Technology
Amazon Bedrock AgentCore 認証・認可入門
hironobuiga
2
470
SREの仕事を自動化する際にやっておきたい5つのポイント
jacopen
6
1.2k
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
110
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
810
EventBridge API Destination × AgentCore Runtimeで実現するLambdaレスなイベント駆動エージェント
har1101
7
290
KubeCon + CloudNativeCon NA ‘25 Recap, Extensibility: Gateway API / NRI
ladicle
0
160
Werner Vogelsが14年間 問い続けてきたこと
yusukeshimizu
2
280
DEVCON 14 Report at AAMSX RU65: V9968, MSX0tab5, MSXDIY etc
mcd500
0
240
AI時代、1年目エンジニアの悩み
jin4
1
140
あたらしい上流工程の形。 0日導入からはじめるAI駆動PM
kumaiu
4
660
生成AI時代にこそ求められるSRE / SRE for Gen AI era
ymotongpoo
4
1.5k
GSIが複数キー対応したことで、俺達はいったい何が嬉しいのか?
smt7174
3
120
Featured
See All Featured
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
55
49k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
740
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
46
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
130
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
91
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
240
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Between Models and Reality
mayunak
1
180
BBQ
matthewcrist
89
10k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Transcript
... und das kann man dann als PDF runterladen
$ who am i Andreas Heigl PHP & PDF seit
~15 Jahren @heiglandreas
[email protected]
... und das kann man dann als PDF runterladen Was
ist PDF Was ist PDF nicht? Warum PDF? Auswahl von Bibliotheken Vergleich Code-Beispiele
Was ist PDF
Was ist PDF Seitenbeschreibungs-Definition PDF - 82 qm / 6,5kg
Papier (1310 Seiten) HTML - 24qm / 2kg Papier (389 Seiten)
Was ist PDF Austauschformat Containerformat WYSIWYG
Was ist PDF nicht
Was ist PDF nicht Unveränderlich Immer gleich Sicher
Warum PDF?
Warum? Ausdrucken Mitnehmen Aufbewahren Unveränderlich
Warum: Ausdrucken @print{} Highend-Druckdaten
Warum:Mitnehmen @print{} Speichern als PDF Speichern als Webseite mit Bildern
Warum:Aufbewahren Ah! PDF-Dateien PDF-Dateien mit Archiv-Informationen
Warum: Unveränderlich Vergesst es! Jedes PDF lässt sich bearbeiten und
verändern! Signierte PDF-Dateien
PDF und PHP
Bibliotheken Konvertierender Ansatz Programatischer Ansatz
Bibliotheken Konvertierend DOMPDF HTML2PDF pdflatex PHPpdf Document-Komponente der zetaComponents
DOMPDF Nutzt intern PDFlib oder R&OS/CPDF Nutzung: dompdf http://example.org
HTML2PDF Nutzt intern TCPDF Letzte Aktualisierung 2011 Nutzung: html2pdf http://example.org
pdflatex Nutzt intern LaTeX LaTeX-Dokument muss programmatisch erstellt werden Nutzung:
pdflatex meinHtmlDocument.tex Wandelt dann in meinHtmlDocument.pdf
PHPpdf Konvertiert XML > PDF Basiert auf Zend_Pdf
ZetaComponents Verarbeitet diverse Eingangsformate (XHTML, ReST, DocBook, odt, Confluence, Mediawiki)
Nutzt intern TCPDF oder Haru Eigene Konverter möglich
// Convert some input RSTfile to docbook $document = new
ezcDocumentRst(); $document-‐>loadFile( './article/introduction.txt' ); // Load the docbook document and create a PDF from it $pdf = new ezcDocumentPdf(); $pdf-‐>options-‐>errorReporting = E_PARSE | E_ERROR | E_WARNING; // Load a custom style sheet $pdf-‐>loadStyles( 'custom.css' ); // Add a customized footer $pdf-‐>registerPdfPart( new ezcDocumentPdfFooterPdfPart( new ezcDocumentPdfFooterOptions( array( 'showDocumentTitle' => false, 'showDocumentAuthor' => false, 'height' => '10mm', ) ) ) ); // Add a customized header $pdf-‐>registerPdfPart( new ezcDocumentPdfHeaderPdfPart( new ezcDocumentPdfFooterOptions( array( 'showPageNumber' => false, 'height' => '10mm', ) ) ) ); $pdf-‐>createFromDocbook( $document-‐>getAsDocbook() ); file_put_contents( __FILE__ . '.pdf', $pdf );
Bibliotheken Programmatisch FPDF/FPDI PDF-PHP/CPDF Zend_Pdf pdflatex PDFlib lite TCPDF PDFlib
FPDF PHP 4 Nicht mehr weitergeführt
FPDI Zum Import von PDF-Dateien
PHP-PDF/CPDF Kommerzielle Bibliothek Free for Non-Commercial use
Zend_Pdf Wird aktuell nicht weiterentwickelt Rewrite steht z.Zt. nicht an
Basiert auf PDF-1.4 Einziges Projekt, das PDFs bearbeiten kann!! Sauberer OO-PHP-Code
pdflatex Kein „in-memory“ erzeugen einer PDF-Datei Lässt sich wunderbar auslagern
LaTeX-Kentnisse
libHaru Freie PDF-Bibliothek Länger keine Updates C-Bibliothek auch für andere
Sprachen
pdflib lite Stand von PDFlib 7 Nur für Nicht-Kommerzielle OpenSource-
Projekte Kein Support
TCPDF Free & OpenSource Dokumentation lässt zu wünschen übrig. Nicola
Asuni steht hinter TCPDF Import von PDF-Dateien nur über FPDI Signierte PDFs sind einfach zu erstellen Funktionsumfang ausreichend Code smells....
PDFlib teuer, ClosedSource Dokumentation Thomas Merz stehen hinter PDFlib C-Bibliothek
auch für andere Sprachen nutzbar Neueste Features aus PDF
Vergleich
Vergleich TCPDF PDFlib Kosten Lizenz PDF erstellen PDF bearbeiten PDF
importieren verschlüsseln Geschwindigkeit Standards Schrifttypen Sprache 0,- ab 800,- € GPL3 Commercial ✔ ✔ ✘ ✘ ✔ (mit FPDF) ✔ (Je nach Lizenz) ✔ ✔ (mit Zusatzprodukt) 10 PDF in > 10 s 50 PDF in 4,08s PDF/A-1b PDF/A1-3, PDF/X1-4, PDF/VT, PDF/UA TrueType, OpenType(TTF), Type1, CID TrueType, OpenType, Type1, CID PHP C
Code-Beispiele Zu finden unter https://github.com/heiglandreas/pdfexamples
ressources http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/ pdfs/pdf_reference_1-7.pdf http://www.w3.org/TR/REC-html40/ http://www.pdfx-ready.ch/index.php?show=496 https://github.com/dompdf/dompdf http://html2pdf.fr/de/default https://de.wikipedia.org/wiki/PdfTeX https://github.com/psliwa/PHPPdf https://github.com/zetacomponents/Document
http://www.fpdf.org https://github.com/lsolesen/fpdi https://github.com/johnwhitington/cpdf-source http://framework.zend.com/manual/1.12/de/zend.pdf.usage.html http://libharu.org http://pdflib.com http://tcpdf.org
Fragen?
Danke!