Specify one or more content sources to render into a single PDF document
The parts
parameter allows you to define the content sources that will be rendered into your PDF document.
When generating a PDF, you need to specify what content to render. The parts
parameter accepts an array of content sources, which can be URLs, HTML strings, or structured content objects. These sources are rendered sequentially into a single PDF document.
Defines the content sources that will be rendered into your PDF document
Min items: 1
Max items: 50
Item types: URL string, HTML string, or content object
The parts
parameter accepts three types of content:
type
and content
fields. The content object can be:
type: "url"
type: "html"
type: "template"
(see the Templates page for details)Each content part is rendered sequentially in the order provided, creating a multi-page PDF where each part typically starts on a new page.
This parameter is particularly useful for:
Multi-source documents: Combine content from multiple webpages into a single PDF.
Mixed content types: Blend web content with custom HTML in the same document.
Report generation: Create comprehensive reports by combining dynamic web content with static templates.
Document assembly: Build documents from multiple components stored in different locations.
Dynamic content injection: Use templates with context data to generate personalized documents.
For more details on using templates, see the Templates documentation.