ThomasLatham / markdown-pdf-plus

The source code for the Visual Studio Code extension Markdown PDF Plus.
https://marketplace.visualstudio.com/items?itemName=tom-latham.markdown-pdf-plus
Other
2 stars 0 forks source link

Background Image support in PDF #9

Closed czarodziej91 closed 2 weeks ago

czarodziej91 commented 3 weeks ago

It seems, that currently background-images are not supported on PDF export.

Reproduction steps:

  1. In your md file add a reference to stylesheet. <link rel="stylesheet" type="text/css" href="../Styles/main.css">.
  2. In your stylesheet set a background image property with an url body > div { background-image: url("./Images/tausta.png");}.
  3. Export your md file to HTML. - Background image will load as expected.
  4. Export your md file to PDF. - Background Image will not be loaded in PDF.

I can print the PDF from the HTML exported version of my md file. In Chrome browser I can go to Options -> Print and mark "Print Background Colors and Images" option to true image

I suppose markdown-pdf-plus does not support that option when exporting to PDF. It would be nice if it could be set in an extension settings or was always set by default.

Btw since I have the opportunity - very nice solution you created, thank you very much :)

ThomasLatham commented 3 weeks ago

Thank you very much for opening this issue and for the detailed reproduction steps! I have just now used those steps to confirm your findings, and I will start on implementing support for background images.

Thank you so much too for using and appreciating this extension!

ThomasLatham commented 2 weeks ago

Hi @czarodziej91, I've just release v1.2.1 which includes changes to address this issue. Can you please confirm whether this new version provides support for background images when exporting PDFs?

czarodziej91 commented 2 weeks ago

Hi Thomas, once I updated a plugin, I started to receive a following error: image So I cannot quite check the functionality behind. Once I downgraded to version 1.2.0 of the extension everything works the old way, so there is no error.

ThomasLatham commented 2 weeks ago

Hmm, it seems I've broken the extension. Thanks for the update. I'll get to work on fixing it as soon as I can

czarodziej91 commented 2 weeks ago

Sure, I'll keep following the issue. For me, the background part is not urgent at all, as a workaround exists with printing from HTML exported file.

ThomasLatham commented 2 weeks ago

Thanks for your patience. I just released v1.2.3 which should not be broken and also should support background images.

czarodziej91 commented 2 weeks ago

Awesome, works perfectly in all cases so far. Thank you :)