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
44
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
45
Schei� encoding
heiglandreas
0
74
Aus alt mach neu
heiglandreas
0
29
Other Decks in Technology
See All in Technology
20260204_Midosuji_Tech
takuyay0ne
1
160
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
240
Cosmos World Foundation Model Platform for Physical AI
takmin
0
980
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
4
1.4k
Exadata Fleet Update
oracle4engineer
PRO
0
1.1k
Webhook best practices for rock solid and resilient deployments
glaforge
2
310
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
610
今日から始めるAmazon Bedrock AgentCore
har1101
4
420
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
260
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.4k
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
610
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
320
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5k
Accessibility Awareness
sabderemane
0
57
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
70
Large-scale JavaScript Application Architecture
addyosmani
515
110k
30 Presentation Tips
portentint
PRO
1
220
Building the Perfect Custom Keyboard
takai
2
690
Scaling GitHub
holman
464
140k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Speed Design
sergeychernyshev
33
1.5k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Believing is Seeing
oripsolob
1
58
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
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!