Unable to Convert Markdown to PDF in VS Code

Viewed 5053

I have installed the markdown extension in VS code however, when I attempt to convert it via Pressing F1 and selecting the below:

Export Markdown to PDF

I am using Windows

I receive the following errors:

Error received

Full Error:

Error: Failed to launch the browser process! /home/myname/.vscode-server/extensions/yzane.markdown-pdf-1.4.4/node_modules/puppeteer-core/.local-chromium/linux-722234/chrome-linux/chrome: error while loading shared libraries: libXcursor.so.1: cannot open shared object file: No such file or directory TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md

Any ideas?

I am able to see it has created the _tmp.html file, but it stops there and doesn't finalise the conversion pdf

The Markdown Extension I have installed in VS code is: Markdown PDF by yzane

Cheers, Michael

2 Answers

I am guessing that you are using VSCode with [WSL: Ubuntu]. Unfortunately you are in the same boat as me. I have been informed that WSL and windows have a missmatch sometimes, and Chromium for windows is the victim in this case. I have scoured the net and the only way to fix it makes you vulnerable to outside forces.

You can use grip or pandoc instead.

tagging onto @nekounborn with a recommendation for pandoc:

i had this exact problem, and you taught me that pandoc exists. thankyou!

for my own memory, as well as for other people reaching this: there is a vscode extension called vscode-pandoc that lets you render to html, xdocx and pdf. it needs you to have pandoc in your linux environment, and latex-pdf if you want to make pdfs.

the first apt-get command below installs pandoc, the next all the things needed to create pdfs with it

$ sudo apt-get update && sudo apt-get install pandoc
$ sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra
Related