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?
optionalafterOptionsContent?: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?
optionalbeforeImageContent?: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?
optionaldisplayLogoAt?:"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?
optionalgetFileName?: (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?
optionalgetFooter?: () =>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?
optionalgetHeader?: (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
Data for the tab being rendered on this page
index
number
Page number or index
pageSettings
Page dimensions and layout settings
Returns
string
HTML content for the page header
getPdfContent?
optionalgetPdfContent?: (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
Array of tab data to include in the document
pageSettings
Page dimensions and layout settings
Returns
Promisable<string>
Complete HTML content for the PDF document. Return an empty string when the callback handles download and completion itself; Mimeeq then emits no additional completion.
handleExport?
optionalhandleExport?: (url,context) =>Promisable<PdfExportCompleted|null|undefined>
Takes over product PDF delivery after the file has been generated.
Receives a signed PDF URL valid for 24 hours and fetchable from any site.
Treat the URL like the file itself. Mimeeq does not fetch the file for you.
Return { completed: true } to stop Mimeeq's download, or null/undefined
to continue to processFile and the normal download.
Throws, rejections and unsupported results log a warning and continue the
normal flow. After 60 seconds without a result, Mimeeq closes its loader,
logs a warning and downloads nothing. Late results are ignored. Return
{ completed: true } as soon as you take over and finish longer work in
the background.
Runs before processFile, including when getPdfContent renders the PDF.
Applies only to product PDF exports, not quotation, basket or getPDF exports.
Parameters
url
string
context
Returns
Promisable<PdfExportCompleted | null | undefined>
Example
window.mimeeqApp.config.pdf = {
handleExport: async (url, context) => {
if (!isTradeCustomer()) return null;
await sendPdfToCrm(url, context.fileName);
return { completed: true };
},
};
headElements?
optionalheadElements?: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.
logo?
optionallogo?: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?
optionallogoPosition?:"MIDDLE"|"LEFT"|"RIGHT"
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?
optionalpageRenderers?: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?
optionalpageSettings?: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?
optionalprepareTabData?: (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
Original tab data
Returns
Modified tab data for rendering
processFile?
optionalprocessFile?: (url,context) =>Promisable<string|void|Blob|null>
Processes or takes over delivery of the generated product PDF.
Receives a signed PDF URL valid for 24 hours and fetchable from any site. Treat the URL like the file itself; fetch it yourself if you need its bytes. Return:
- a
Blobto download that file undercontext.fileName, - an
https://URL to download a hosted replacement, nullto download the original PDF,- nothing (
void/undefined) to finish without a Mimeeq download, for example after attaching the PDF to an email.
Throws, rejections, unsupported results or a 30-second timeout log a warning and download the original PDF. Late results are ignored. When taking over, finish the callback within 30 seconds to avoid the fallback download.
For hosted files, use HTTPS, Content-Type: application/pdf and
Content-Disposition: attachment; filename="...", without requiring cookies.
On iOS, use context.isIos to choose a hosted URL if Blob downloads are
unsuitable. Without the attachment header, a hosted PDF may replace the page.
Mimeeq does not upload processed files.
Runs when handleExport is absent or declines the export. Applies only to
product PDF exports, including custom getPdfContent output.
Parameters
url
string
context
Returns
Promisable<string | void | Blob | null>
Example
window.mimeeqApp.config.pdf = {
processFile: async (url, { shortCode }) => {
if (!shortCode) return null; // Download the original.
const file = await (await fetch(url)).blob();
return addShortCode(file, shortCode); // Your own post-processing.
},
};