Export in the browser
const bytes = await editor.pdf({ dpi: 150 });
const url = URL.createObjectURL(new Blob([bytes], { type: "application/pdf" }));
const link = document.createElement("a");
link.href = url;
link.download = "document.pdf";
link.click();
setTimeout(() => URL.revokeObjectURL(url), 1000);Here editor is an open Word editor. Catch failures and show a visible error; keep the session available for retry. The standard ribbon already supplies Download PDF. For a custom viewer, call browserDocument.pdf(options). Export waits for earlier edits, and cancellation of an export leaves the document available.
Export on a server
Use document.pdf({ dpi: 150, signal }) on a document opened by createRenderer. Reuse the renderer, dispose individual documents and close it on shutdown. See the complete Node example or the HTTP export endpoint. Data-only Node analysis does not need Chromium; paginated PDF output does.
Understand output and DPI
PDF retains mixed document page sizes and includes searchable text, links, bookmarks and supported tags for headings, lists, tables and figures. Supported graphics use vector paths. Visible native text and complex effects are retained as raster layers, so increasing DPI improves their sharpness while increasing output size and temporary memory use. Default PDF output is 150 DPI.
Fonts affect line breaks, page count and output. Supply the same fonts across environments. HTML attachments and application overlays are not exported. Supported fields refresh; unsupported or locked fields retain their documented cached/authored behavior.
Evaluate accessibility and delivery
Tagged structure is not PDF/UA certification. Check reading order, descriptions and text selection in your intended readers, especially for bidirectional text and complex clusters. Keep the source DOCX when recipients need to continue editing.
Deploy lazy PDF chunks with the browser bundle. Completed output stays in memory until export finishes. Use your application storage or download controls to deliver it. Evaluation marks must be retained; a suitable trial or commercial key removes them under the license terms.