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
45
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
大規模ECサイトのあるバッチのパフォーマンスを改善するために僕たちのチームがしてきたこと
panda_program
1
370
契約書からの情報抽出を行うLLMのスループットを、バッチ処理を用いて最大40%改善した話
sansantech
PRO
1
170
俺の/私の最強アーキテクチャ決定戦開催 ― チームで新しいアーキテクチャに適合していくために / 20260322 Naoki Takahashi
shift_evolve
PRO
1
420
コンテキスト・ハーネスエンジニアリングの現在
hirosatogamo
PRO
6
750
Bill One 開発エンジニア 紹介資料
sansan33
PRO
5
18k
スピンアウト講座02_ファイル管理
overflowinc
0
1.1k
「コントロールの三分法」で考える「コト」への向き合い方 / phperkaigi2026
blue_goheimochi
0
140
ABEMAのバグバウンティの取り組み
kurochan
1
600
スピンアウト講座01_GitHub管理
overflowinc
0
1.2k
データマネジメント戦略Night - 4社のリアルを語る会
ktatsuya
1
170
テストプロセスにおけるAI活用 :人間とAIの共存
hacomono
PRO
0
140
Phase08_クイックウィン実装
overflowinc
0
1.5k
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
640
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Building AI with AI
inesmontani
PRO
1
820
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Are puppies a ranking factor?
jonoalderson
1
3.1k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
220
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
200
What does AI have to do with Human Rights?
axbom
PRO
1
2k
Deep Space Network (abreviated)
tonyrice
0
95
The Curse of the Amulet
leimatthew05
1
10k
GraphQLの誤解/rethinking-graphql
sonatard
75
11k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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!