Skip to content
Inkoxide

Search covers every page and heading of the docs. Use ↑ ↓ and ↵.

In the browser

Edit this page

@inkoxide/vue/browser renders in a Web Worker, with @inkoxide/wasm installed:

  • usePdf(document, options?) renders document (a VNode, a component, or a ref or getter of one) at once and whenever it changes, and gives blob, url, loading and error as refs, and update(). A function that takes props is a functional component; one that takes none is a getter. A render that starts stops the one still running; the end of the scope stops it and revokes the URL.
  • <PdfViewer :document> shows the PDF in an <iframe>, in the browser's viewer (#fallback before the first render, :show-toolbar="false" to hide the viewer's toolbar); <PdfDownloadLink :document file-name="…"> is a link that downloads it, its default slot given the render's state; <BlobProvider :document v-slot="{ blob, url, loading, error }"> hands the state to its slot.
  • renderToBlob and renderToStream (a web stream).

They render again only when the document is another one: a VNode of another component or key, or with 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/vue/GUIDE.md in the inkoxide repository.