Unable to Convert Markdown to PDF in VS Code
Asked Answered
C

5

6

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

Cloy answered 30/10, 2020 at 6:43 Comment(1)
Try to follow the instructions in the troubleshooting guide you have in your post. Go to the install dependencies section and do the install there.Testator
S
5

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.

Stylograph answered 29/3, 2021 at 1:19 Comment(1)
Hey there, thanks so much for getting back to me, excuse my super delayed reply. Appreciate your response, I have found a workaround as well :)Cloy
H
2

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
Hypercritical answered 11/4, 2022 at 20:2 Comment(0)
T
1

This is quite an old question but the problem is still there.

When I read the error message in full I saw that it says that it cannot find the libXss.so.1

I solved this by simply installing this in my WSL2 Ubuntu:

sudo apt install libxss1

I hope it helps others in the same situation.

This link is also posted in the error message should you have other issues as well:

https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

Testator answered 26/4, 2023 at 12:2 Comment(0)
G
0

I tried vscode-pandoc but I got some errors that made it unusable. However, I found the VSCode extension Markdown to PDF very helpful and intuitive to use. So I share here hoping this may help, even if the thread is quite old.

Giana answered 22/2, 2024 at 14:32 Comment(0)
D
0

for dnf:

sudo dnf install chromium libXScrnSaver
Dryden answered 21/10, 2024 at 8:33 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.