mupdf.js
mupdf.js copied to clipboard
New document from SVG not supported
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'