Represents a command to get a PDF from Metabox Modular Configurator.
This class sends a message to the Metabox API to generate a PDF based on the current configuration.
The document is streamed to the browser as a download once it is ready — that path needs no
subscription and has not changed.
The PDF is not stored anywhere, so there is no document handle to receive. To follow the render
rather than just let it land, listen to the 'pdfStatusChanged' event before sending the command:
it reports 'started', then 'ready' or 'failed'.
Remarks
pdfStatusChanged is additive and requires configurator-side support. Where the configurator does
not emit it yet, the automatic download remains the only signal — so use the event for progress and
error reporting, and never gate the export flow on it alone.
What does it unlock?
Generates a native MetaBox PDF document server-side. The download works on its own;
pdfStatusChanged additionally makes the render observable — whether it started, finished or failed.
Practical Application
Generates a branded PDF from the current configurator state. Use for B2B quote workflows,
downloadable spec sheets, or emailing configured product summaries to prospects. Subscribe to
pdfStatusChanged to disable the export button while the render runs — it is not instant, and a
second click starts a second render — and to surface a failure instead of leaving the user waiting.
AI Coding Best Practices
api.sendCommandToMetabox(new GetPdf()) takes no parameters. Subscribe to pdfStatusChanged BEFORE
sending. Do not wait for a file handle: there is none, the browser download is the delivery. Keep a
timeout of your own, since a configurator without this event will never report. Failure detail, when
available, arrives on statusMessageChanged.
//Subscribe to the event before sending the command to ensure you capture the response api.addEventListener('pdfStatusChanged', (status: PdfStatus) => { if (status === 'failed') { console.warn('PDF render failed'); } console.log('PDF render:', status); });
Represents a command to get a PDF from Metabox Modular Configurator. This class sends a message to the Metabox API to generate a PDF based on the current configuration. The document is streamed to the browser as a download once it is ready — that path needs no subscription and has not changed.
The PDF is not stored anywhere, so there is no document handle to receive. To follow the render rather than just let it land, listen to the 'pdfStatusChanged' event before sending the command: it reports
'started', then'ready'or'failed'.Remarks
pdfStatusChangedis additive and requires configurator-side support. Where the configurator does not emit it yet, the automatic download remains the only signal — so use the event for progress and error reporting, and never gate the export flow on it alone.What does it unlock?
Generates a native MetaBox PDF document server-side. The download works on its own;
pdfStatusChangedadditionally makes the render observable — whether it started, finished or failed.Practical Application
Generates a branded PDF from the current configurator state. Use for B2B quote workflows, downloadable spec sheets, or emailing configured product summaries to prospects. Subscribe to
pdfStatusChangedto disable the export button while the render runs — it is not instant, and a second click starts a second render — and to surface a failure instead of leaving the user waiting.AI Coding Best Practices
api.sendCommandToMetabox(new GetPdf())takes no parameters. Subscribe topdfStatusChangedBEFORE sending. Do not wait for a file handle: there is none, the browser download is the delivery. Keep a timeout of your own, since a configurator without this event will never report. Failure detail, when available, arrives onstatusMessageChanged.Example