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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
開発メンバーが語るFindy Conferenceの裏側とこれから
sontixyou
2
460
最速で価値を出すための プロダクトエンジニアのツッコミ術
kaacun
1
480
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
0
230
無ければ作る! バイブコーディングで作ったものを一気に紹介
tatsuya1970
0
110
CDKで始めるTypeScript開発のススメ
tsukuboshi
1
210
Azure SQL Databaseでベクター検索を活用しよう
nakasho
0
140
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
2
670
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
300
re:Inventで出たインフラエンジニアが嬉しかったアップデート
nagisa53
4
230
しろおびセキュリティへ ようこそ
log0417
0
240
【NGK2026S】日本株のシステムトレードに入門してみた
kazuhitotakahashi
0
280
【インシデント入門】サイバー攻撃を受けた現場って何してるの?
shumei_ito
0
1.3k
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
The Limits of Empathy - UXLibs8
cassininazir
1
210
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
36k
We Are The Robots
honzajavorek
0
150
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
130
Color Theory Basics | Prateek | Gurzu
gurzu
0
190
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
610
A Tale of Four Properties
chriscoyier
162
24k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
2.9k
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!