vscode-markdown-pdf icon indicating copy to clipboard operation
vscode-markdown-pdf copied to clipboard

Mermaid not in PDF

Open stefanhuber opened this issue 4 years ago • 4 comments

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

stefanhuber avatar Jun 30 '20 10:06 stefanhuber

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. Excel validation report

Sidenote: PlantUML works fine on all formats.

CaBazaga avatar May 12 '22 18:05 CaBazaga

Hi @CaBazaga I have the same problem, have you been able to solve it?

lsondakh avatar May 24 '22 10:05 lsondakh

Nope, I switched to use plantUML to move forward.

CaBazaga avatar May 24 '22 12:05 CaBazaga

Here is my workaround.

  1. Install "markdown Preview Enhanced" on VSC.
  2. Right click on the markdown text file, and then, "Open Preview to the Slide"
  3. Now you have the preview with mermaid diagram.
  4. 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.

nnawata avatar Jun 07 '22 05:06 nnawata