Skip to content

New document from SVG not supported #178

Closed

Description

@Downchuck

SVG Read-in support does not appear to be working.

In PyMuPDF, this works fine:

doc = pymupdf.Document(stream=bytearray(svg_str, "utf-8"))

In MuPDF.js, it fails:

doc = mupdf.Document.openDocument(new TextEncoder().encode(svg), "svg");
Error: cannot find document handler for file type: 'svg'
doc = mupdf.Document.openDocument(new TextEncoder().encode(svg));
warning: ... repeated 6 times...
format error: cannot find version marker
warning: trying to repair broken xref
warning: repairing PDF document
... 
Error: no objects found
const doc = mupdf.Document.openDocument("./please.svg");
Error: cannot find document handler for file type: './please.svg'

Activity

  1. artifex-tor commented on Aug 12, 2026

    @artifex-tor

    SVG import is not supported intentionally to keep the size of the Wasm binary down. Browsers have much better SVG support! If you really need SVG support, you should build the mupdf.js library from source with a custom feature set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions