mupdf.js icon indicating copy to clipboard operation
mupdf.js copied to clipboard

New document from SVG not supported

Open Downchuck opened this issue 9 months ago • 0 comments

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'

Downchuck avatar Jun 04 '25 18:06 Downchuck