In the browser
@inkoxide/svelte/browser mounts the template in an element of no document and renders the PDF in
a Web Worker, with @inkoxide/wasm installed:
createPdf(() => document, () => options)renders the document at once and whenever what the function reads changes, and givesblob,url,loadinganderror, andupdate(). Call it while a component is created; destroying the component stops the render and revokes the URL.<PdfViewer {document}>shows the PDF in an<iframe>, in the browser's viewer (afallbacksnippet before the first render,showToolbar={false}to hide the viewer's toolbar);<PdfDownloadLink {document} fileName="…">is a link that downloads it, its children snippet given the render's state;<BlobProvider {document}>hands the state to its children snippet.renderToBlobandrenderToStream(a web stream).
They render again only when the document is another one: another component, or other prop values. Where the engine and the fonts come from, a CDN and Content Security Policy are in the React guide's In the browser.
Synced from packages/svelte/GUIDE.md in the inkoxide repository.