Skip to content

Releases: dragonofmercy/php-pdf

v1.11.0

15 Jun 09:56

Choose a tag to compare

Added

  • Open, read, import, and edit encrypted PDFs (RC4 40/128-bit, AES-128, AES-256) across PdfReader, Document::importPdf(), and PdfEditor. Pass the password, or omit it for permissions-only files; edits keep the source's encryption.
  • PdfEditor::flattenFields() - freeze filled AcroForm fields into static page content (all fields or a named subset; signature and button fields are kept). Works on encrypted PDFs.
  • Filling or flattening fields that use a font embedded in the document (simple Type1 / TrueType or composite Type0) now generates the correct appearance instead of failing.
  • PdfEditor::deletePages() and reorderPages() (1-based) - delete and reorder pages of an existing PDF. Deleting a page automatically cleans up the bookmarks, named destinations, and internal links that pointed to it. Works on encrypted PDFs.

v1.10.0

12 Jun 10:05

Choose a tag to compare

Added

  • PDF/A-1 conformance (ISO 19005-1, PDF 1.4-based), levels 1b and 1a via enablePdfA(PdfALevel::A1B) / A1A. Emits a %PDF-1.4 header and forbids transparency entirely - an alpha PNG, an SVG with opacity below 1.0, or an SVG mask/filter is rejected with a clear error. veraPDF-validated.
  • PDF/A-4 conformance (ISO 19005-4, PDF 2.0-based) via enablePdfA(PdfALevel::A4), plus the A4F flavour for embedded files (e.g. Factur-X / ZUGFeRD). Emits a %PDF-2.0 header, identifies via pdfaid:rev, and omits the deprecated /Info dictionary. veraPDF-validated.

With PDF/A-1, the library now supports the full PDF/A family - parts 1, 2, 3, and 4 are all veraPDF-conformant.

v1.9.0

11 Jun 11:59

Choose a tag to compare

Added

  • 13 new standard page formats on PageFormat, usable anywhere a format is accepted (e.g. addPage(PageFormat::A2)):
    • ISO A series: A0, A1, A2, A7
    • ISO B series: B4, B5
    • ISO C envelopes: C4, C5, C6, DL
    • North American: TABLOID (Ledger, 11x17 in), EXECUTIVE, HALF_LETTER

v1.8.0

11 Jun 11:19

Choose a tag to compare

Added

  • Read existing PDFs - PdfReader parses any non-encrypted PDF (classic xref tables and cross-reference streams, object streams, the standard stream filters), with lazy object resolution and page-tree access.
  • Template import - Document::importPdf() / importPdfBytes() plus Page::template() draw any page of an existing PDF as an opaque background or stamp (letterheads, overlays, watermarking); works with encryption, tagging, and signatures.
  • Modify existing PDFs - PdfEditor::open() / PdfEditor::fromBytes() write changes as an appended incremental revision that leaves the original bytes (and any signatures) intact: refresh metadata and append new pages with the full page API, on both classic xref and cross-reference-stream sources.
  • Fill AcroForm fields - inspect a form with formFields() / field(), then fill text, checkbox, radio, combobox, and listbox fields with setField(); each filled field receives a generated /AP appearance stream.
  • Sign existing PDFs - PdfEditor::open()->sign() with full parity to Document: sign(), addSignature(), addDocumentTimestamp(), and enableLtv(), RFC 3161 timestamps, the PAdES profiles (B-B / B-T / B-LT / B-LTA), and LTV/DSS, each a stacked incremental revision covering all prior edits. Reuses an empty signature field by name or creates one - invisible by default, or visible with a Helvetica caption via SignatureAppearance.

v1.7.0

09 Jun 07:35

Choose a tag to compare

Added

  • Right-to-left text (Hebrew) - Unicode bidirectional algorithm reordering on cells and tables, with setBaseDirection(), a per-cell() direction: argument, Cell::direction(), and the Direction enum. RTL right-aligns by default; byte-identical output when no RTL text is present.
  • Arabic shaping - contextual presentation forms (isolated/initial/medial/final) and mandatory lam-alef ligatures on cells and tables, in pure PHP (requires a font whose cmap carries the Arabic presentation forms).
  • RTL Markdown - bidi reordering and Arabic shaping in Page::markdown() and cell(markdown: true), with right-aligned RTL blocks and mirrored list markers / blockquote bars.
  • Inter-document TTF parse cache - parsed custom fonts are memoized in-process and shared across every Document; transparent and byte-identical, with ParsedTtfCache::clear() to reset it in long-running workers.

v1.6.0

08 Jun 09:11

Choose a tag to compare

Added

  • Tagged PDF - Document::enableTagging() accumulates a logical structure tree and emits /StructTreeRoot, /MarkInfo, the ParentTree and per-page /StructParents. Opt-in; byte-identical output when off.
  • PDF/UA-1 conformance - Document::enablePdfUA() produces output that validates isCompliant under the veraPDF PDF/UA-1 profile: artifacts, figure alternate text, header-cell /Scope, DisplayDocTitle, an XMP pdfuaid packet, and a fail-fast conformance guard.
  • Tagged hyperlinks - text links (cell(link:, linkAlt:)), Markdown inline links, and image links (image(link:, linkAlt:) and Markdown [![alt](img)](url)) are tagged as <Link> structure elements wrapping their content, with /OBJR, /StructParent and /Contents. Markdown block images now carry /Alt.
  • PDF/A level A - enablePdfA(PdfALevel::A2A) and A3A emit PDF/A-2a / PDF/A-3a (Unicode requirements plus a tagged structure tree). Combining with enablePdfUA() yields a single file that is both PDF/A-2a and PDF/UA-1. This completes PDF/A level support (B, U, A across parts 2 and 3).

v1.5.0

04 Jun 13:18

Choose a tag to compare

Added

  • Table cell spanning: data cells span columns with Cell::colSpan(), plus grouped headers via TableStyle::withColumnGroups() and ColumnGroup (rowspan not yet supported).
  • Multi-column text flow: Page::columns() flows cell() and markdown() across equal-width columns, filling each column before the next and continuing onto new pages.
  • Text justification: TextAlign::JUSTIFY fills each wrapped line to the cell width for both Page::cell() and Page::table() columns.

v1.4.2

04 Jun 08:25

Choose a tag to compare

Fixed

  • Composer dist archive no longer ships development-only files (tests/, .github/, bin/, phpunit.xml, phpstan.neon, composer.lock, dotfiles). They are now export-ignored, leaving a lean vendor/ install. 5db89a0

v1.4.1

04 Jun 05:25

Choose a tag to compare

Fixed

  • Page::markdown() and Page::table() now advance the cursor below the rendered block by default ($ln defaults to NextPosition::BELOW), so consecutive flowing calls stack down the page instead of overwriting each other. Pass ln: NextPosition::NONE to keep the previous behaviour. (fc55e26)

v1.4.0

03 Jun 11:22

Choose a tag to compare

Added

  • Page::image() now accepts a NextPosition $ln parameter, so images advance the page cursor after drawing like cell() and barcode() (RIGHT / NEWLINE / BELOW / NONE). The default RIGHT preserves the previous behaviour.