Skip to content

Dynamic Options

Dynamic options are document rendering settings sent via the uhuu_dynamic_options key in the payload to Uhuu’s rendering services, enabling customized handling of both input and output. These options can be configured at runtime.

Customizing the File Name

  • filename_format: Specifies a list of data paths to format the filename.
  • filename_separator (optional, default: _): Defines the separator used between filename elements.
json
{
  "uhuu_dynamic_options": {
    "filename_format": ["listing.detail.wp_propertyreferencenumber__c", "language"],
    "filename_separator": "_"
  }
}
// output: "20.69.435_de.pdf"

Static Parameters

If a data path starts with _ or -, it is treated as a static parameter.

json
{
  "uhuu_dynamic_options": {
    "filename_format": [
      "listing.detail.wp_propertyreferencenumber__c",
      "_Doku",
      "language"
    ],
    "filename_separator": "_"
  }
}
// output: "20.69.435_Doku_de.pdf"

Filename Helper Methods

  • now(): Appends the current date and time (YYYY-MM-DD-HHmm) to filename_format.
  • today(): Appends the current date (YYYY-MM-DD) to filename_format.
json
{
  "uhuu_dynamic_options": {
    "filename_format": [
      "listing.detail.wp_propertyreferencenumber__c",
      "_Doku",
      "now()"
    ],
    "filename_separator": "_"
  }
}
// output: "20.69.435_Doku_2024-04-03-0826.pdf"

Filename Length Limit

File names are limited to 60 characters. Excess characters will be truncated.

Create PDF from a Website

  • remote_url: Generates a PDF from a specified website or a dynamic template URL.
json
{
  "uhuu_dynamic_options": {
    "remote_url": "https://app.uhuu.io/print"
  }
}

Shop Preview Options

Preview options are used in the uhuu shop.

json
{
  "uhuu_preview": {
    "low": true,
    "mode": "horizontal",
    "url": "https://sample.com/template-url.html"
  }
}