Skip to main content

RenderCSS

This configuration sets general rules for how Print CSS rendering is done.

The configuration is located in /rendercss/config.ion.

The configuration file itself is optional.

All properties in the configuration file are also optional.

Project config files inherit properties from tenant config files which inherit from the global defaults as given below.

Typical Project Configuration Example​

rendercss configs differ a lot in practice. So, the following gives a hint for what they look like. It is not meant as boilerplate code.

// /tenants/mytenant/projects/myproject/rendercss/config.ion
{
templatingEngine : "handlebars",
renderingEngine : "princexml",
xmpTemplating : false,
princeXml : {
verbose: true,
debug: true,
noWarnCssUnknown: true,
noWarnCssUnsupported: true,
httpTimeout: 30,
javaScript: false,
maxPasses: 5,
pdfLang: "",
pdfProfile: "",
pdfOutputIntent: "",
allbackCmykProfile: "",
taggedPdf: true
}
}

Global Defaults​

// /rendercss/config.ion
{
documentTemplate: "default",
templatingEngine : "handlebars",
renderingEngine : "weasyprint",
xmpTemplating : false,
// same as renderpdf
keepLog: "onerror",
keepLogForSeconds: 86400, // 1 day
keepLogUntil: "shippedOrExpired",
keepOutput: "onsuccess",
keepOutputUntil: "shippedOrExpired",
keepOutputForSeconds: 86400, // 1 day
maxExecutionMillis: 60000, // 1 min
redeliverOnError: [],
}

WeasyPrint Configuration​

pdfVariant​

Specify the PDF conformance variant to generate (for example, PDF/A or PDF/UA).

  • Data Type: string
  • Default: None

pdfVersion​

Specify the target PDF specification version.

  • Data Type: string
  • Default: None

pdfForms​

Generate interactive PDF forms from HTML form elements.

  • Data Type: boolean
  • Default: false

pdfTags​

Generate a tagged PDF to improve accessibility and document structure.

  • Data Type: boolean
  • Default: false

uncompressedPdf​

Disable PDF stream compression. This produces larger PDF files but can simplify debugging.

  • Data Type: boolean
  • Default: false

customMetadata​

Embed custom document metadata defined in the HTML into the generated PDF.

  • Data Type: boolean
  • Default: false

presentationalHints​

Enable support for HTML presentational hints such as align, bgcolor, and similar legacy attributes.

  • Data Type: boolean
  • Default: false

srgb​

Embed an sRGB ICC color profile to ensure consistent color rendering across PDF viewers.

  • Data Type: boolean
  • Default: false

optimizeImages​

Optimize embedded images to reduce the generated PDF size.

  • Data Type: boolean
  • Default: false

jpegQuality​

Set the JPEG compression quality used when optimizing JPEG images. Valid values range from 0 (lowest quality) to 95 (highest quality).

  • Data Type: integer
  • Default: None

dpi​

Set the maximum image resolution in dots per inch (DPI). Images exceeding this resolution are downsampled.

  • Data Type: integer
  • Default: None

fullFonts​

Embed complete font files instead of only the glyphs used in the document.

  • Data Type: boolean
  • Default: false

hinting​

Preserve font hinting information to improve text rendering on some displays.

  • Data Type: boolean
  • Default: false

timeout​

Specify the maximum rendering time before the process is terminated. This option is typically handled by the application invoking WeasyPrint rather than WeasyPrint itself.

  • Data Type: integer
  • Default: None

noHttpRedirects​

Prevent WeasyPrint from following HTTP redirects when downloading external resources.

  • Data Type: boolean
  • Default: false

failOnHttpErrors​

Fail the rendering process if any external HTTP resource returns an error response.

  • Data Type: boolean
  • Default: false

verbose​

Enable verbose logging with additional informational messages.

  • Data Type: boolean
  • Default: false

debug​

Enable debug logging with detailed diagnostic information.

  • Data Type: boolean
  • Default: false

quiet​

Suppress all non-error log output.

  • Data Type: boolean
  • Default: false

PrinceXML Configuration​

verbose​

Region Logging options. Enable logging of informative messages.

  • Data Type: boolean
  • Default: true

debug​

Enable logging of debug messages.

  • Data Type: boolean
  • Default: true

noWarnCssUnknown​

Disable warnings about unknown CSS features.

  • Data Type: boolean
  • Default: true

noWarnCssUnsupported​

Disable warnings about unsupported CSS features

  • Data Type: boolean
  • Default: true

httpTimeout​

Specify the timeout for HTTP requests. The HTTP timeout in seconds. Value must be greater than 0.

  • Data Type: int
  • Default: 30

javaScript​

Specify whether JavaScript found in documents should be run. Enable if document scripts should be run.

  • Data Type: boolean
  • Default: false

maxPasses​

Defines the maximum number of consequent layout passes. The number of maximum passes. Value must be greater than 0.

  • Data Type: int
  • Default: 5

pdfLang​

Specify the PDF document's Lang entry in the document catalog. The PDF document's lang entry.

  • Data Type: String
  • Default: null

pdfProfile​

Specify the PDF profile to use.

  • Data Type: String
  • Default: null

pdfOutputIntent​

Specify the ICC profile to use.

  • Data Type: String
  • Default: null

allbackCmykProfile​

Set fallback ICC profile for uncalibrated CMYK. The fallback ICC profile.

  • Data Type: String
  • Default: null

taggedPdf​

Enable tagged PDF.

  • Data Type: boolean
  • Default: true