Six office formats, one converter
Send DOCX, XLSX, PPTX, ODT, ODS, or ODP and the bridge detects the format from the file extension and hands it to Gotenberg’s LibreOffice conversion. One call path covers every supported office format.
Engine extension
Office-to-PDF conversion via the Gotenberg microservice.
NextPDF Gotenberg bridges Gotenberg’s LibreOffice-powered document conversion with NextPDF. It sends Office documents (DOCX, XLSX, PPTX, ODT, ODS, ODP) to a Gotenberg microservice via PSR-18 HTTP, receives the converted PDF, and returns it ready for NextPDF post-processing: digital signatures, PDF/A-4 archival output, and watermarks.
How it fits
Send DOCX, XLSX, PPTX, ODT, ODS, or ODP and the bridge detects the format from the file extension and hands it to Gotenberg’s LibreOffice conversion. One call path covers every supported office format.
The bridge talks to Gotenberg over PSR-18, so it stays vendor-agnostic about how requests are sent. Wire in Guzzle, Symfony HttpClient, Buzz, or any PSR-18 implementation you already use, and swap it while keeping conversion code unchanged.
Gotenberg returns a PDF that flows straight back into the NextPDF engine for post-processing. Add signatures, PDF/A output, or watermarks to the converted document in the same pipeline, with SSRF protection, file-size limits, filename sanitization, and Content-Type validation guarding the request.
Get started
composer require nextpdf/gotenbergIn code
use NextPDF\Gotenberg\GotenbergBridge;
use NextPDF\Gotenberg\GotenbergConfig;
$config = new GotenbergConfig(
apiUrl: 'https://gotenberg.example.com',
timeout: 30,
apiKey: 'your-api-key',
);
$bridge = new GotenbergBridge(
config: $config,
httpClient: $psrHttpClient,
requestFactory: $psrRequestFactory,
streamFactory: $psrStreamFactory,
);
$result = $bridge->convertFile('/path/to/report.docx');
file_put_contents('/path/to/report.pdf', $result->pdfData);if ($bridge->isAvailable()) {
echo 'Gotenberg is ready';
} else {
echo 'Gotenberg is not available';
}Capabilities
When to use it
Use this when you need to turn Office documents (DOCX, XLSX, PPTX, ODT, ODS, ODP) into PDFs through a Gotenberg/LibreOffice microservice, then post-process them with NextPDF (signatures, PDF/A, watermarks).