Skip to content

API reference

Quittio\Core\Pdf

quittio/core#

Quittio\Core\Pdf

  • EmbeddedXmlInvoice XML to be embedded into a PDF/A-3 (ZUGFeRD/Factur-X, XRechnung in PDF).
  • LogoCachePrepares logos for the PDF and caches the result.
  • PdfEmbeddedFileExtractorExtracts the embedded invoice XML from PDF files (ZUGFeRD 2.x, Factur-X, XRechnung in PDF).
  • PdfException
  • PdfRenderer interfaceTurns HTML (from the template) into a PDF, embedding the invoice XML if requested.
  • RemoteImageFetcherDownloads remote logos without server-side request forgery: only http and https, only hosts whose every resolved address (IPv4 and IPv6) is publicly routable, the connection pinned to the checked address (no second DNS lookup) and every redirect checked again.
  • RenderRequestInput for a PDF renderer.

Quittio\Core\Pdf\PostProcessing

  • MpdfPostProcessorImports the pages of an existing PDF (FPDI via mPDF), embeds the XML and writes PDF/A-3 metadata and output intent.
  • PdfPostProcessor interfaceTurns an existing PDF into PDF/A-3 with embedded invoice XML (for callback and passthrough renderers).

Quittio\Core\Pdf\Qr

  • EpcGiroCodeGeneratorEPC QR code ("GiroCode") for SEPA credit transfers, guideline EPC069-12 version 002.
  • PaymentQrGenerator interfaceCreates the payload of a payment QR code (GiroCode, Swiss QR bill, …).
  • PaymentSlipThe texts of a payment slip with receipt (ProvidesPaymentSlip), laid out by the templates after the Swiss QR bill: receipt (62 mm) and payment part (148 mm) in a strip of 210 × 105 mm at the bottom of the page, with the code at 46 × 46 mm.
  • ProvidesPaymentSlip interfaceA payment QR code generator whose code belongs on a payment slip of its own, e.g. the payment part and receipt of the Swiss QR bill. The default templates then print the slip at the bottom of a page of its own instead of the small code next to the bank details.
  • QrImageRenders QR codes as SVG data URIs for templates (no further dependency besides mpdf/qrcode).

Quittio\Core\Pdf\Renderers

  • CallbackRendererOwn rendering function (e.g. Browsershot, Gotenberg) that returns PDF binary data. PDF/A and the embedded XML are added by the post processor.
  • DenyingHttpClientmPDF HTTP client that refuses every request (defence in depth).
  • MpdfRendererDefault renderer: HTML/CSS to PDF/A-3b with mPDF, in pure PHP.
  • PassthroughRendererUses a finished PDF supplied by the application; only PDF/A and the XML are added.

Quittio\Core\Pdf\Xmp

  • FacturXXmpXMP metadata for Factur-X/ZUGFeRD: the fx description and the PDF/A extension schema. Without the extension schema the PDF is readable, but not valid PDF/A.

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.