github gotenberg/gotenberg-php v3.0.0

4 hours ago

This release brings the client up-to-date with the Gotenberg 9 version.

See https://github.com/gotenberg/gotenberg/releases/tag/v9.0.0 for more details.

Breaking Changes

  • Minimum PHP version is now PHP 8.3.
  • Gotenberg::pdfEngines() becomes Gotenberg::pdf(): each route is a stage, run with run() or stages()->pipe().
  • The post-processing methods of the conversions (merge(), split(), pdfa(), pdfua(), metadata(), flatten(), encrypt(), allow*(), facturX(), embeds(), optimizeImages(), watermarking(), stamping(), rotating()) become stages. SplitMode, FacturX and EmbedMetadata give way to Stage.
  • Fields with an engine twin take the native prefix: nativePages(), nativeBookmarks(), nativeTaggedPdf(), nativePdfa(), nativePdfua(), nativeQuality(), nativeWatermark*(), and so on. paperSize() takes a PaperSize, paperDimensions() the width and height.
  • webhook() takes the events URL, which Gotenberg requires; the error webhook is gone.
  • downloadFrom(), cookies() and the failOn*() methods are variadic, emulatedMediaFeatures() takes an array.
  • Stream exposes filename and stream as readonly properties.
  • Parameters with a fixed set of values take backed enums instead of strings (Profile, PaperSize, SameSite, WebhookMethod…). FacturX::CONFORMANCE_* becomes FacturXLevel, EmbedMetadata::RELATIONSHIP_* becomes Relationship. nativePdfua() takes no argument: LibreOffice only writes PDF/UA-1.
  • JSON encoding errors throw JsonException.
  • The deprecated trace() and getGotenbergTrace() are removed: use correlationId() and getCorrelationId().

New Methods

  • $chromium->pdf()/->stages(...) and $libreOffice->stages(...): run a list of stages, in order, on the PDFs a conversion makes. Stage has a named constructor per Gotenberg stage: merge, split, select, stampText, stampImage, remediate, sign, optimize, and so on. A stage that reads a file takes a Stream, which the client uploads for you.
  • Gotenberg::pdf($apiUrl)->stages(...)->pipe(...): run a list of stages on the PDFs you upload, through /forms/pdf/pipe.
  • Gotenberg::pdf($apiUrl)->run(Stage::..., ...): run one stage through its own route, /forms/pdf/merge, /forms/pdf/sign, and so on.
  • Gotenberg::pdf($apiUrl)->info(), ->metadata(), ->bookmarks(), ->attachments(), ->form() and ->validate(): read PDFs, one JSON entry per PDF. ->password() opens encrypted ones.

Don't miss a new gotenberg-php release

NewReleases is sending notifications on new releases.