API Configuration for PDF Processor
PSPDFKit Processor has been deprecated and replaced by PSPDFKit Document Engine. All PSPDFKit Processor licenses will work as before and be supported until 15 May 2024 (we will contact you about license migration). To start using Document Engine, refer to the migration guide. With Document Engine, you’ll have access to robust new capabilities (read the blog for more information).
While PSPDFKit Processor works out of the box, some parts need to be configured to work. Configuration options for the server are exposed via environment variables in your
LICENSE_KEY— This is the license key used to activate PSPDFKit Processor. If this isn’t specified or if it’s incorrect, PSPDFKit Processor won’t start up.
The following options concern authentication:
JWT_PUBLIC_KEY— This is the public key used to verify the JSON Web Token (JWT) payload signature. Ensure that this public key corresponds to the private key used to generate JWTs in your app. For more information, see the authentication guide.
JWT_ALGORITHM— This is the algorithm used for JWT verification. This should be the same as the one you’ll use for signing JWTs in your app. Supported algorithms: RS256, RS512, ES256, ES512. See RFC 7518 for details about specific algorithms.
API_AUTH_TOKEN— This can be set instead of
JWT_PUBLIC_KEYto enable API token-based authentication. See the authentication guide for details.
API_AUTH_TOKENare mutually exclusive. If both are set, Processor will immediately shut down after being started.
There are also some optional configuration options:
PORT— The port PSPDFKit Processor is listening on. Defaults to
HTTPS_PROXY— A proxy server used for fetching remote documents.
STATSD_PORT— Host and port of a running StatsD daemon that PSPDFKit Processor can report telemetry data to.
REMOTE_URL_FETCH_TIMEOUT— The timeout in milliseconds applied when fetching documents from a remote URL. Defaults to
MAX_UPLOAD_SIZE_BYTES— The maximum size in bytes uploaded documents can be. This applies to all upload types, including remote documents. Defaults to
1000000000(one billion) bytes, or about 950 MB.
LIBREOFFICE_CONVERSION_TIMEOUT— The timeout in milliseconds applied when converting an Office document using LibreOffice. Any conversion taking longer than the configured timeout will fail. Defaults to
PSPDFKIT_WORKER_POOL_SIZE— This option controls how many
pspdfkitdprocesses are started for handling PDF-related work. In general, setting this to two-to-three times the number of cores available will give you the best performance. Keep in mind that if you set this too high, the processes will starve each other for CPU time, leading to unnecessarily long processing times. And if you set this too low, available CPU time won’t be used efficiently, as tasks will have to wait for a long time for a worker to be available. This defaults to
ALLOW_REMOTE_ASSETS_IN_GENERATION— This option controls whether PDF Generation will be able to access and fetch external resources, such as images or styles. This defaults to
PDF_GENERATION_TIMEOUT— This option sets the timeout in milliseconds for generating a PDF. Defaults to
PSPDFKIT_WORKER_TIMEOUT— This option sets the timeout in milliseconds for some core PDF operations. The default is
PROCESSOR_REQUEST_TIMEOUT— This option sets the timeout in milliseconds for all requests to Processor’s
/processendpoint. The default is
60000(1 minute). Note that this timeout overrides all other timeout settings for any request to Processor.
Mounting Ephemeral Storage for Temporary Files
PSPDFKit Processor uses the
/srv/pspdfkit/assets/tmp directory to store temporary files instead of the default
To store temporary files separately, mount the storage to the