mgieseki / dvisvgm

A fast DVI, EPS, and PDF to SVG converter
https://dvisvgm.de
GNU General Public License v3.0
306 stars 33 forks source link

Error: unknown font format #216

Closed povpie closed 1 year ago

povpie commented 1 year ago

Objective: run v3 with mutool on Windows to convert a pdf into svg with embedded font (woff)

What I did: uninstalled ghostscript >> set environment variable DVISVGM_PDF_PROC= (mutool folder path) >> checked if the environment is set (it is) >> run the following: dvisvgm --pdf -f,--font-format=woff school.pdf

What I get: ERROR: unknown font format ',--font-format=woff' (supported formats: svg, ttf, woff, woff2)

mgieseki commented 1 year ago

dvisvgm --pdf -f,--font-format=woff school.pdf

Option --font-format is given twice here: -f is the short form of --font-format. So, you should either use -fwoff or --font-format=woff. -f without a format specifier leads to the mentioned error message.

DVISVGM_PDF_PROC= (mutool folder path)

You can't specify the path to mutool here. Only the two values gs and mutool are supported. Therefore, just use set DVISVGM_PDF_PROC=mutool. The file mutool.exe must be located in a directory that's present in the search path, i.e. a directory listed in the PATH environment variable.

povpie commented 1 year ago

I downloaded mutool from this link, but I can't find mutool.exe inside: https://mupdf.com/releases/index.html >> mupdf-1.21.1-source.tar.gz

muzimuzhi commented 1 year ago

I downloaded mutool from this link, but I can't find mutool.exe inside: https://mupdf.com/releases/index.html >> mupdf-1.21.1-source.tar.gz

@povpie There's a mupdf-1.21.0-windows.zip which contains exe files. Looks like mupdf doesn't provide (prebuilt) binary files for every release.

Update: To build from source on Windows,

there is a Visual Studio project file in platform/win32/mupdf.vcproj from https://mupdf.com/docs/building.html

povpie commented 1 year ago

I downloaded mutool from this link, but I can't find mutool.exe inside: https://mupdf.com/releases/index.html >> mupdf-1.21.1-source.tar.gz

@povpie There's a mupdf-1.21.0-windows.zip which contains exe files. Looks like mupdf doesn't provide (prebuilt) binary files for every release.

Update: To build from source on Windows,

there is a Visual Studio project file in platform/win32/mupdf.vcproj from https://mupdf.com/docs/building.html

Successfully converted! Thanks @mgieseki and @muzimuzhi.