Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Und dann kann man das als PDF runterladen...

Und dann kann man das als PDF runterladen...

The state of PDF-creation libraries in PHP (date 2014)...

Avatar for Andreas Heigl

Andreas Heigl

February 24, 2014
Tweet

More Decks by Andreas Heigl

Other Decks in Technology

Transcript

  1. ... und das kann man dann als PDF runterladen Was

    ist PDF Was ist PDF nicht? Warum PDF? Auswahl von Bibliotheken Vergleich Code-Beispiele
  2. Was ist PDF Seitenbeschreibungs-Definition PDF - 82 qm / 6,5kg

    Papier (1310 Seiten) HTML - 24qm / 2kg Papier (389 Seiten)
  3. pdflatex Nutzt intern LaTeX LaTeX-Dokument muss programmatisch erstellt werden Nutzung:

    pdflatex meinHtmlDocument.tex Wandelt dann in meinHtmlDocument.pdf
  4. //  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  );
  5. 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
  6. 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....
  7. PDFlib teuer, ClosedSource Dokumentation Thomas Merz stehen hinter PDFlib C-Bibliothek

    auch für andere Sprachen nutzbar Neueste Features aus PDF
  8. 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