markdown-preview-enhanced icon indicating copy to clipboard operation
markdown-preview-enhanced copied to clipboard

VSCode-MPE-Puppeteer-PDF-Relative Path Not working

Open nirajbhatt7 opened this issue 3 years ago • 4 comments

OS: Windows 10 IDE: VS Code Extension: Markdown Preview Enhanced Exporter: Puppeteer Format: PDF

Issue: When defining path in the front matter to export to a sub folder, Puppeteer tries to save in the sub folder of VS code. Looks like working folder is falling to the executable's folder instead of where my markdown file is. Pandoc handles the path correctly.


id: print class: 'ABCD' puppeteer:
landscape: false format: A4 displayHeaderFooter: false path: "./Exports/test.pdf"

Error:

Error: ENOENT: no such file or directory, open 'C:\xxx\xxx\VSCode\Exports\test.pdf'

nirajbhatt7 avatar Jun 04 '21 05:06 nirajbhatt7

It's 10 days and not reply so bumping this in a hope somebody may see it.

nirajbhatt7 avatar Jun 14 '21 04:06 nirajbhatt7

Just adding to this as I'd like to be able to specify a relative path to the source MD file. Currently the path is relative to the directory in which vscode is located and I can't think of a way around this.

Simple solution would be to be able to include variables but front matter below results in failure. Any ideas?

puppeteer:
  path: ${workspaceFolder}/test.pdf
  format: "A4"

mkuurstra avatar Jul 13 '21 08:07 mkuurstra

It's been a while I guess there is no solution but appreciate if anyone can help.

nirajbhatt7 avatar Oct 01 '21 22:10 nirajbhatt7

I have the same problem

D7x7z49 avatar Sep 01 '22 07:09 D7x7z49