PDF & Browser Options

Customize your PDF document output by passing the options and render blocks in your requests.


Layout and Styling Options (options)

These options determine the size, orientation, margins, and security metadata of the resulting PDF.

ParameterTypeDefaultAvailable OnDescription
formatstring"A4"All PlansPaper formats: "A4", "A3", "Letter", "Legal", "Tabloid".
landscapebooleanfalseAll PlansSet to true for horizontal landscape orientation.
print_backgroundbooleantrueAll PlansRender background graphics, gradients, and colors declared in CSS.
display_header_footerbooleanfalseAll PlansEnable header and footer rendering. Requires templates.
header_templatestringnullAll PlansHTML string for the header. Classes allowed: pageNumber, totalPages, date, title, url.
footer_templatestringnullAll PlansHTML string for the footer. Classes allowed: pageNumber, totalPages, date, title, url.
margin.topstringnullAll PlansTop page margin (e.g. "10mm", "20px", "0.5in").
margin.bottomstringnullAll PlansBottom page margin (e.g. "10mm", "20px").
margin.leftstringnullAll PlansLeft page margin.
margin.rightstringnullAll PlansRight page margin.
scalenumbernullAll PlansScale factor of the webpage rendering (between 0.5 and 2.0). If omitted, it will automatically scale down to fit the page width.
watermarkobjectnullStarter+Overlay watermark text. See Watermark parameters below.
user_passwordstringnullPro+Encrypt and restrict access to the PDF with a password.
compressionobjectnullPro+Optimize and compress the PDF file. See Compression parameters below.

Watermark Parameters (options.watermark)

[!NOTE] Available on Starter plans and higher. If used on Free keys, an error is returned.

  • text (string, required): The watermark overlay text (e.g., "CONFIDENTIAL").
  • color (string, default: "rgba(200, 200, 200, 0.3)"): Transparent CSS color representation.
  • font_size (string, default: "60px"): CSS font size for the watermark string.
  • rotation_degrees (integer, default: -45): Watermark rotation angle.

Compression Parameters (options.compression)

[!NOTE] Available on Pro plans and higher.

  • level (integer, 1-9): Structural optimization. 1-3 basic compression, 4-6 object stream compression, 7-9 full linearization for web viewing.
  • image_quality (integer, 1-100): JPEG lossy image re-compression quality. 80-90 is recommended for high compression with minimal quality loss.

Browser Options (render)

These parameters control browser behavior during loading and navigation.

ParameterTypeDefaultDescription
page_load_timeout_msinteger30000Navigation timeout in milliseconds before failing. Max 60000.
wait_untilstring"load"Load threshold event: "load", "domcontentloaded", "networkidle", "commit".
wait_for_selectorstringnullCSS selector to wait for (e.g., "#charts-loaded") before taking the snapshot.
wait_after_load_msinteger0Artificial pause in milliseconds to wait for JS animations to finish. Max 10000 (10s).