Configure pdfRest API Toolkit Container
Learn how to configure the pdfRest API Toolkit Containerto meet your needs.
Environment variables
The pdfRest API Toolkit Container is highly configurable using environment variables. These control a variety of features, such as maximum file upload size or CPU concurrency. The list of environment variables and their functions are below:
We offer a Free Trial License Key to all accounts on pdfRest.com. Existing account holders can generate a License Key from the Container section of the Account page.
1 for true or 2 for false. Defaults to 1 for true. REMOVE_ORIGINAL_PROCESSED to be 1. Defaults to 1800000 (30 minutes). 1800 (30 minutes) 1000. id UUIDs to visually and programatically identify them. Defaults to 1. id UUIDs to visually and programatically identify them. Defaults to 2. https://pdfrest.com. outputURL for the end-user to retrieve their files after processing. Note: Requires a domain record to be configured. Unless you intend to load a TLS certificate for the Container, set this to an http:// value. PDFREST_MAX_CLU_CONCURRENCY = 3 Setting variables in Docker
In docker these variables can be set under:
services > **pdfrest_service** > env
Setting variables in Kubernetes
In Kubernetes they can be set under:
spec > template > spec > containers > **pdfrest_container** > env
msCoreFonts
Microsoft Core Fonts are not licensed to be distributed with pdfRest API products but they are freely available from SourceForge for you to install. These are optional when deploying the pdfRest API and enable the following features:
- Support maximum file size reduction with Compress PDF by enabling font subsetting
- Subsetting the fonts that are embedded in the document is an important step to reduce PDF file size. The subset of the font contains only those font characters actually used in the PDF document.
- Support font embedding, a required step to Convert to PDF/A
- Embedding fonts in your output PDF document ensures that the document can be opened and viewed on any machine, because the fonts travel with that document. Quite literally, the necessary font files are saved within that PDF file. This is required for all PDF/A specifications to support long-term preservation.
- Expand the set of supported fonts that may be used with Watermark PDF and Add to PDF's
/pdf-with-added-textendpoint- Once installed,
msCoreFontsare available for use with the Watermark PDF and Add to PDF API Tools, expanding the set of fonts that can be applied.
- Once installed,
If you receive either of the follow error messages in the container logs, then msCoreFonts is not included with your deployment.
Adding msCoreFonts to the Image
Use the following Dockerfile to add the Microsoft Core Fonts package to a pdfRest image.
Use a command like what follows, together with the supplied Dockerfile, to create an pdfrest image with the fonts installed:
Customize this command to fit your needs:
- You can update
PDFREST_TAGif you intend to pin your image to a specificpdfrest/pdf-api-toolkitversion. - Update the
--tagoption to point the output to your internal or personal registry.
Once the fonts are added, the pdfRest API Toolkit Container will automatically configure itself to work with them, enabling the features described above. You will see the following messages in the Container logs that indicate that the fonts were found, subsetting has been turned on, and the profiles have been updated: