Open fuhrmanator opened 4 years ago
I read more about ImageMagick and basically it's only a raster solution. So, I hacked around it, maybe it can give you an idea of how to make a more flexible design.
For the Image Magick Path setting, I used use-rsvg-convert.bat
(I'm on windows 10). I know in the code that the extension will now call for plantuml diagrams
use-rsvg-convert.bat inputfile.svg outputfile
So, I next created use-rsvg-convert.bat
and put it in my PATH somewhere:
:: Workaround to use rsvg-convert rather than imagemagick to create PDF files
rsvg-convert %1 -f pdf -o %2
Then when I generate PlantUML files, I must always specify {filename=something.pdf}
(it has to be PDF, because of the -f pdf
in the batch file or it won't work).
I'm using Pandoc export for this kind of markdown:
Exporting this works OK, except the raster file is pixelated in the PDF file (that's normal, because I used a PNG).
However, PlantUML uses SVG (vector) format as a base. That is what is shown in the preview. I can see in the Windows Task Manager that PlantUML is running under the VSCode group with the
-pipe
and-tsvg
options, which is likely how the diagrams are drawn in the preview.Switching the format to
filename=seq.svg
in the markdown gives me a fileassets/seq.svg
which is indeed an SVG file. However, when I examine that file, it actually has a raster content:I see in the mume code (if I'm understanding it properly) that
pandocExport
converts all SVG to PNG with ImageMagick, which explains why, when it's put back to SVG there's a PNG inside (even though the SVG doesn't render in the Pandoc).I tried using pdf and eps as filetypes, and they work. But it's the same problem -- they are raster forms of my diagram when exported to Pandoc.
Exporting to Prince gets it right (the PlantUML diagrams are vectorial), I guess because it groks SVG whereas Pandoc (pdflatex) does not? It would be nice to tell PlantUML to output it as EPS or PDF (those types are supported).