vscode-markdown-pdf
vscode-markdown-pdf copied to clipboard
Mermaid not in PDF
I successfully generate HTML from markdown. It includes Mermaid and plantuml. However, inside the PDF, jpg and png there is only the source code. I checked all settings and couldn't find anything about it.
My setup: Windows 10 markdown-pdf: 1.4.4 VS Code: 1.46.1
This markdown, taken directly from the plugin Readme.
# mermaid test
```mermaid
stateDiagram
[*] --> First
state First {
[*] --> second
second --> [*]
}
```
Does render on HTML but not on any other format, instead I get a "syntax error" image.
Sidenote: PlantUML works fine on all formats.
Hi @CaBazaga I have the same problem, have you been able to solve it?
Nope, I switched to use plantUML to move forward.
Here is my workaround.
- Install "markdown Preview Enhanced" on VSC.
- Right click on the markdown text file, and then, "Open Preview to the Slide"
- Now you have the preview with mermaid diagram.
- Right click on the preview, then select "Chrome (Pupperteer) - PDF" $^1$ or "Open in Browser"$^2$
$^1$ PDF will be directly created to your folder. $^2$ The output image will be shown on your browser, and use Print to PDF function.