Skip to main content

Interface: ApiPdfConfig

Configuration options for PDF document generation.

This interface provides comprehensive customization options for PDF documents, including layout settings, content formatting, branding elements, and custom rendering functions. These options allow businesses to create professional, brand-consistent documentation for their products.

Well-designed PDF documents are crucial for customers who need printed specifications, tear sheets for client presentations, or documentation for manufacturing and ordering.

Properties

afterOptionsContent?

optional afterOptionsContent: string

Additional content to display after the options list in the configuration section.

This can be used for disclaimers, notes about customization options, or other information that should follow the product configuration details.

This content appears in the main specification section of the PDF, providing important context or additional information about the configuration.


beforeImageContent?

optional beforeImageContent: string

Additional content to display before the product image.

This can be used for introductory text, context about the visualization, or highlighting specific aspects of the product that will be shown.

This content appears near the product visualization in the PDF, helping to explain or draw attention to key visual features.


displayLogoAt?

optional displayLogoAt: "FIRST_PAGE" | "ALL_PAGES"

Controls which pages display the logo.

Determines whether the logo appears only on the first page or on all pages of the document, balancing branding visibility with clean design.

For longer documents, showing the logo on all pages ensures brand presence throughout, while first-page-only keeps subsequent pages cleaner.


getFileName()?

optional getFileName: (productName, sku) => Promisable<string>

Custom function to generate the PDF filename.

This allows for dynamic naming based on product details, configuration, date, or other factors relevant to the business process.

Consistent, meaningful filenames help customers and sales teams organize and find documentation when needed.

Parameters

productName

string

Name of the current product

sku

string

SKU code for the current configuration

Returns

Promisable<string>

Filename for the PDF document (with or without .pdf extension)


getFooter()?

optional getFooter: () => Promisable<string>

Custom function to generate the document footer HTML.

This allows for completely custom footer designs with company branding, contact information, legal notices, or other content that should appear consistently at the bottom of pages.

Footers often include copyright information, page numbers, document dates, or company contact details.

Returns

Promisable<string>

HTML content for the PDF footer


getHeader()?

optional getHeader: (tabData, index, pageSettings) => string

Custom function to generate the header for each page.

This allows for custom headers that may include page numbers, section titles, dates, or other context-specific information based on the page content.

Headers are a key branding element and provide important context for users when viewing or printing the document.

Parameters

tabData

PdfDocumentTab

Data for the tab being rendered on this page

index

number

Page number or index

pageSettings

PageSettings

Page dimensions and layout settings

Returns

string

HTML content for the page header


getPdfContent()?

optional getPdfContent: (tabs, pageSettings) => Promisable<string>

Custom function to generate the complete PDF content HTML.

This allows for full control over the entire document's structure and formatting, overriding the default tab-based layout with custom designs.

This is the most powerful customization option, allowing for completely bespoke PDF designs that precisely match your brand guidelines and documentation requirements.

Parameters

tabs

PdfDocumentTab[]

Array of tab data to include in the document

pageSettings

PageSettings

Page dimensions and layout settings

Returns

Promisable<string>

Complete HTML content for the PDF document


headElements?

optional headElements: PDFHeadElement[]

Custom HTML head elements to include in the PDF document.

These can include custom CSS styles, fonts, or meta information that affects the rendering of the document.

Custom head elements are particularly useful for injecting fonts, styling rules, or metadata that should be part of the generated PDF.


optional logo: string

URL to the company logo for branding the PDF.

This logo typically appears in the header or cover page, providing consistent corporate branding on all generated documents.

The logo should be high resolution enough for print quality while still being reasonably sized for efficient document generation.


logoPosition?

optional logoPosition: "LEFT" | "RIGHT" | "MIDDLE"

Horizontal positioning of the logo in the header.

Controls whether the logo appears on the left, center, or right side of the header, with text positioned accordingly around it.

This should align with your brand guidelines and document design principles.


pageRenderers?

optional pageRenderers: Partial<{ [key: string]: PdfPageRenderer; configuration: PdfPageRenderer; finishes: PdfPageRenderer; gallery: PdfPageRenderer; popular_static: PdfPageRenderer; text: PdfPageRenderer; }>

Custom rendering functions for specific tab types.

This allows for complete customization of how different content types are rendered in the PDF, providing fine-grained control over the appearance of each section.

Each renderer is responsible for generating the HTML for a specific tab type, allowing for consistent styling across similar content types while still providing customization for each.


pageSettings?

optional pageSettings: PageSettings

Basic page layout and sizing configuration.

Controls the physical dimensions, margins, and orientation of the PDF pages. This affects how the document will print and display in PDF viewers.


prepareTabData()?

optional prepareTabData: (tab) => PdfDocumentTab

Custom function to preprocess tab data before rendering.

This allows for filtering, reformatting, or enhancing the data for specific tabs before they are rendered into the PDF.

This is useful for adding computed values, formatting data differently for PDF output, or conditionally showing/hiding content based on business rules.

Parameters

tab

PdfDocumentTab

Original tab data

Returns

PdfDocumentTab

Modified tab data for rendering