Node.js SDK

The Node.js SDK is the fastest way to start generating and processing PDFs from your Javascript services.

Source code: github.com/pdfgate/pdfgate-sdk-node
Package: npmjs.com/package/pdfgate

Installation

Install the official package from npm, then initialize the client with your API key. The SDK supports modern Node.js environments and works well in backend applications and automation flows.

Quick start

The example below generates a PDF from a URL and writes the binary response to a local file.

What the SDK covers

The SDK wraps the same core operations available through the REST API. You can start with the SDK for convenience and still use the broader API reference for endpoint-level details.

Core methods

MethodPurpose
generatePdfGenerate a PDF from a URL or HTML input.
getDocumentRetrieve document metadata and file information.
getFileDownload the binary PDF file for a document.
uploadUpload a file.
flattenPdfFlatten interactive PDF form fields.
compressPdfReduce PDF size and optionally return JSON metadata.
watermarkPdfApply text or image watermarks to a PDF.
protectPdfEncrypt a PDF and restrict editing, copying, or printing.
extractPdfFormDataRead submitted values from fillable PDF forms.

Related documentation

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