PHP SDK

The PHP SDK provides a client for integrating PDFGate API endpoints into your PHP applications. It is designed for frameworks like Laravel, Symfony, and custom backend workflows that require reliable, direct access to all API operations.

Source code: github.com/pdfgate/pdfgate-sdk-php
Package: packagist.org/packages/pdfgate/pdfgate-sdk-php

Requirements

  • PHP 7.4+

Installation

Install the package with Composer, then initialize the client with your API key.

Quick start

The example below generates a PDF from a URL and returns a pre-signed file URL.

Generate from HTML

You can also generate a PDF directly from raw HTML and attach metadata to the resulting document.

Download a file

Use getFile to retrieve the output stream and save it locally.

Core methods

MethodPurpose
generatePdfGenerate a PDF from HTML or a public URL.
uploadFileUpload a PDF file for later transformations.
getFileDownload the PDF stream for a stored document.
getDocumentRetrieve document metadata and file URLs.
flattenPdfFlatten interactive PDF fields into a static document.
compressPdfCompress a PDF and return the resulting document record.
protectPdfEncrypt a PDF and apply access restrictions.
watermarkPdfApply text or image watermarks to a document.
extractPdfFormDataRead form field values from a fillable PDF.

Related documentation

Use the SDK together with the main API documentation for request parameters, endpoint behavior, and workflow guides such as webhooks and PDF form fields.