[{"data":1,"prerenderedAt":371},["ShallowReactive",2],{"navigation_docs":3,"-guide-browser-preview":73,"-guide-browser-preview-surround":366},[4,26,57],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":25},"Getting started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,15,20],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Usage","\u002Fgetting-started\u002Fusage","1.getting-started\u002F3.usage","i-lucide-play",false,{"title":27,"icon":28,"path":29,"stem":30,"children":31,"page":25},"Guide","i-lucide-book-marked","\u002Fguide","2.guide",[32,37,42,47,52],{"title":33,"path":34,"stem":35,"icon":36},"Options and frontmatter","\u002Fguide\u002Foptions-frontmatter","2.guide\u002F1.options-frontmatter","i-lucide-sliders-horizontal",{"title":38,"path":39,"stem":40,"icon":41},"Locale files","\u002Fguide\u002Flocale-files","2.guide\u002F2.locale-files","i-lucide-languages",{"title":43,"path":44,"stem":45,"icon":46},"Plugins","\u002Fguide\u002Fplugins","2.guide\u002F3.plugins","i-lucide-puzzle",{"title":48,"path":49,"stem":50,"icon":51},"Custom components","\u002Fguide\u002Fcustom-components","2.guide\u002F4.custom-components","i-lucide-component",{"title":53,"path":54,"stem":55,"icon":56},"Browser preview","\u002Fguide\u002Fbrowser-preview","2.guide\u002F5.browser-preview","i-lucide-monitor",{"title":58,"icon":59,"path":60,"stem":61,"children":62,"page":25},"Reference","i-lucide-book-open","\u002Freference","3.reference",[63,68],{"title":64,"path":65,"stem":66,"icon":67},"Syntax matrix","\u002Freference\u002Fsyntax-matrix","3.reference\u002F1.syntax-matrix","i-lucide-table",{"title":69,"path":70,"stem":71,"icon":72},"Host options","\u002Freference\u002Fhost-options","3.reference\u002F2.host-options","i-lucide-settings",{"id":74,"title":53,"body":75,"description":359,"extension":360,"links":361,"meta":362,"navigation":363,"path":54,"seo":364,"stem":55,"__hash__":365},"docs\u002F2.guide\u002F5.browser-preview.md",{"type":76,"value":77,"toc":355},"minimark",[78,87,245,250,285,289,293,344,351],[79,80,81,82,86],"p",{},"Use ",[83,84,85],"code",{},"comark-pdf\u002Fpreview"," to show PDF bytes in the browser without writing a file.",[88,89,94],"pre",{"className":90,"code":91,"language":92,"meta":93,"style":93},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { renderPdf } from 'comark-pdf'\nimport { mount } from 'comark-pdf\u002Fpreview'\n\nconst bytes = await renderPdf(markdownString)\nconst handle = mount(document.getElementById('preview'), bytes)\n\n\u002F\u002F Later, to free the Blob URL:\nhandle.revoke()\n","ts","",[83,95,96,129,149,156,178,219,224,231],{"__ignoreMap":93},[97,98,101,105,109,113,116,119,122,126],"span",{"class":99,"line":100},"line",1,[97,102,104],{"class":103},"s7zQu","import",[97,106,108],{"class":107},"sMK4o"," {",[97,110,112],{"class":111},"sTEyZ"," renderPdf",[97,114,115],{"class":107}," }",[97,117,118],{"class":103}," from",[97,120,121],{"class":107}," '",[97,123,125],{"class":124},"sfazB","comark-pdf",[97,127,128],{"class":107},"'\n",[97,130,132,134,136,139,141,143,145,147],{"class":99,"line":131},2,[97,133,104],{"class":103},[97,135,108],{"class":107},[97,137,138],{"class":111}," mount",[97,140,115],{"class":107},[97,142,118],{"class":103},[97,144,121],{"class":107},[97,146,85],{"class":124},[97,148,128],{"class":107},[97,150,152],{"class":99,"line":151},3,[97,153,155],{"emptyLinePlaceholder":154},true,"\n",[97,157,159,163,166,169,172,175],{"class":99,"line":158},4,[97,160,162],{"class":161},"spNyl","const",[97,164,165],{"class":111}," bytes ",[97,167,168],{"class":107},"=",[97,170,171],{"class":103}," await",[97,173,112],{"class":174},"s2Zo4",[97,176,177],{"class":111},"(markdownString)\n",[97,179,181,183,186,188,190,193,196,199,202,205,208,210,213,216],{"class":99,"line":180},5,[97,182,162],{"class":161},[97,184,185],{"class":111}," handle ",[97,187,168],{"class":107},[97,189,138],{"class":174},[97,191,192],{"class":111},"(document",[97,194,195],{"class":107},".",[97,197,198],{"class":174},"getElementById",[97,200,201],{"class":111},"(",[97,203,204],{"class":107},"'",[97,206,207],{"class":124},"preview",[97,209,204],{"class":107},[97,211,212],{"class":111},")",[97,214,215],{"class":107},",",[97,217,218],{"class":111}," bytes)\n",[97,220,222],{"class":99,"line":221},6,[97,223,155],{"emptyLinePlaceholder":154},[97,225,227],{"class":99,"line":226},7,[97,228,230],{"class":229},"sHwdD","\u002F\u002F Later, to free the Blob URL:\n",[97,232,234,237,239,242],{"class":99,"line":233},8,[97,235,236],{"class":111},"handle",[97,238,195],{"class":107},[97,240,241],{"class":174},"revoke",[97,243,244],{"class":111},"()\n",[246,247,249],"h2",{"id":248},"typical-flow","Typical flow",[251,252,253,264,279],"ol",{},[254,255,256,257,260,261,195],"li",{},"Render markdown to ",[83,258,259],{},"Uint8Array"," with ",[83,262,263],{},"renderPdf()",[254,265,266,267,270,271,274,275,278],{},"Call ",[83,268,269],{},"mount(container, bytes)"," — creates a Blob URL and embeds it (for example in an ",[83,272,273],{},"\u003Ciframe>"," or ",[83,276,277],{},"\u003Cobject>",").",[254,280,266,281,284],{},[83,282,283],{},"handle.revoke()"," when the preview is removed to release the Blob URL.",[286,287,288],"note",{},"Preview mounts bytes only. It does not re-parse markdown. Re-render when the source changes.",[246,290,292],{"id":291},"when-to-use-preview-vs-download","When to use preview vs download",[294,295,296,309],"table",{},[297,298,299],"thead",{},[300,301,302,306],"tr",{},[303,304,305],"th",{},"Approach",[303,307,308],{},"Use when",[310,311,312,323,333],"tbody",{},[300,313,314,320],{},[315,316,317],"td",{},[83,318,319],{},"mount()",[315,321,322],{},"Live preview in an editor or report studio",[300,324,325,330],{},[315,326,327],{},[83,328,329],{},"renderPdfToFile()",[315,331,332],{},"Server export or CLI",[300,334,335,341],{},[315,336,337,338],{},"Raw ",[83,339,340],{},"bytes",[315,342,343],{},"Attach to email, upload to storage, or pipe to another API",[79,345,346,347,350],{},"See ",[348,349,21],"a",{"href":22}," for the full render API.",[352,353,354],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":93,"searchDepth":131,"depth":131,"links":356},[357,358],{"id":248,"depth":131,"text":249},{"id":291,"depth":131,"text":292},"Mount PDF bytes in the DOM with comark-pdf\u002Fpreview and revoke Blob URLs when done.","md",null,{},{"icon":56},{"title":53,"description":359},"nkmlC1sAT-ukhtduL5PmjWCrGsX-blbX_PXK09x9nJM",[367,369],{"title":48,"path":49,"stem":50,"description":368,"icon":51,"children":-1},"Override Comark component tags with jasy element factories for barcodes, charts, or alerts.",{"title":64,"path":65,"stem":66,"description":370,"icon":67,"children":-1},"How Comark syntax maps to comark-pdf and jasy PDF primitives.",1794911899847]