QuestPDF Server is an open-source API server that allows you to generate PDF documents using a simple JSON-based API.
It's powered by QuestPDF, a .NET library that allows you to create PDF documents using a fluent API.
To create a document, you need to create a JSON file that describes the document. The JSON file is composed of elements. Each element has a type and a set of properties. The type is used to determine which element to use, and the properties are used to configure the element.
See the Elements page for a list of all available elements.
The page specs are used to configure the document. They are used to set the page size, margins, and other properties.
| Property | Type | Description | Default value |
|---|---|---|---|
| BackgroundColor | string |
The background color of the page | #ffffff |
| Margin | float |
The margin of the page | null |
| MarginUnit | Unit? |
The unit of the margin | null |
| DefaultFontSize | float |
The default font size | 12 |
| PageSize | PageSize |
The size of the page | A4 |
| FontFamily | string? |
The font family | null |
| FontUris | string[] |
The font uris | null |
| Direction | LTR or RTL |
The direction of the page | LTR |
| Orientation | Portrait or Landscape |
The orientation of the page | Portrait |
| BackgroundImageUri | string? |
The background image uri | null |
Allowed values for Unit:
PointMeterCentimetreMillimetreFeetInchMil// 1/1000th of an inch
Allowed values for PageSize:
A0A1A2A3A4A5A6A7A8A9A10B0B1B2B3B4B5B6B7B8B9B10Env10EnvC4EnvDLExecutiveLegalLetterARCH_AARCH_BARCH_CARCH_DARCH_EARCH_E1ARCH_E2ARCH_E3