1

I would like to convert a PDF page created with LaTeX to SVG, in a scriptable fashion (like command line).

I used inkscape on command line, and this partly worked, but I lost the fonts. I guess I need to somehow embed them into the final SVG document.

Does somebody have a better method, either with or without inkscape?

  • 3
    A . pdf can consist of many objects, embedded bitmap images, letters and fonts – and that's just at the basic level. I don't think there's a “one-size-fits-all“ approach to converting that potential hot mess into an .svg. That said, perhaps you could start a step earlier, as it were? There's always dvisvgm. – Ingmar May 10 '22 at 11:35
  • @Ingmar I have seen that dvisvgm also reads PDF. My first try was mixed results: The resulting image looks exactly like the PDF, but instead of text, everything was rendered as paths. This is not nice because e.g. you cannot copy&paste from the SVG any more. Maybe I need to try to create a dvi and see what happens there, or I need to find the right command line options. – J Fabian Meier May 11 '22 at 14:29
  • Ok, found it in the docs: "Selects the file format used to embed font data into the generated SVG output when converting DVI files. It has no effect when converting PDF or PostScript files. Text fragments present in these files are always converted to path elements." – J Fabian Meier May 11 '22 at 14:32
  • 1
    Have you already tried to create DVI rather than PDF files and convert those to SVG? In this case, dvisvgm will create text elements from textual components. – Martin May 11 '22 at 18:02

0 Answers0