OPF

Search docs

Loading documentation…
    OpenPresentation/opf
    Browse docs
    On this page

    Render SVG, PNG and PDF

    Render an individual slide for review or deliver the whole presentation as a PDF.

    Render a preview

    Start in the first-deck starter with its packages installed. Use the starter’s PNG command to render all five slides, then write the same slides to a single PDF.

    From the first-deck starter
    npm run preview
    npx opf convert deck.opf.json review.pdf

    Open the images in slide order. Look for text crossing a region boundary, clipped labels, missing images and font substitutions. Open review.pdf and compare the page count and line breaks with the previews.

    Choose a renderer

    • SVG gives you vector artwork for a slide. Use the renderer’s /svg entry in a browser or on a server.
    • PNG captures the slide at a fixed resolution. The Node converter needs its rasterizer and the fonts used to lay out text.
    • PDF keeps supported text and drawing commands as vectors. Check the render report for effects that used a raster fallback.

    For a website, use the website starter. For an existing application, see the renderer API examples and font loading guide.