@3dsource/metabox-modular-configurator-api
    Preparing search index...

    Class GetPdf

    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'.

    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.

    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.

    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.

    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.

    import { GetPdf, Communicator, PdfStatus } from '@3dsource/metabox-modular-configurator-api';
    window.env3DSource.apiReady = (api: Communicator) => {

    //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);
    });

    api.sendCommandToMetabox(new GetPdf());
    };
    Index
    • Returns GetPdf

    data: ToMetaBoxMessageEnvelope

    The message envelope populated by subclass constructors and sent via Communicator.sendCommandToMetabox.