RickStrahl / MarkdownMonster

An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
https://markdownmonster.west-wind.com
Other
1.59k stars 235 forks source link

@ icons disappear in the PDF #1136

Closed Ben-CO7 closed 2 weeks ago

Ben-CO7 commented 1 month ago

When using Save to PDF, the icons (that show in the preview) disappear in the PDF.

Markdown image

Preview image

PDF image

This wasnt happening until I got the license and it upgraded MM to the latest version.

RickStrahl commented 1 month ago

I think the only reason that worked before is because we didn't use a default style template (Print to PDF). That template hardcodes the font used and it doesn't include FontAwesome.

The problem is that there's no way to embed fonts. The reason it would have worked is that you actually have the FontAwesome fonts installed locally - if it goes to another machine that doesn't have the fonts installed the fonts are likely not going to work.

You can customize the template and add FontAwesome into the font selection (or use one of the non-print templates) to get the old behavior but I wouldn't recommend it as it won't work consistently.

You can get this to work by using Print To PDF which works differently (graphically rendering the content), but there are other limitations to the print output.

RickStrahl commented 1 month ago

Just to be sure I went back and looked at my last v2 release and this works no differently there.

There have been changes in v3 switching from FontAwesome 4 to 6, but it doesn't work in either case with the PDF generator. I tried a few things to see if I would be able to explicitly embed icons, but that simply doesn't work with wkhtmltopdf.

Only way is to Print to Pdf.

RickStrahl commented 1 month ago

I'm adding WebView PDF output support to Markdown Monster and going forward you'll be able to switch between wkhtmltopdf and WebView print modes. Both have some advantages and disadvantages.

WebView Advantages

WebView Disadvantages

Functionality is available in the latest preview release (.NET 9.0 release) - it's a bit rough at the moment as non-supported options still show in the PDF dialog.

RickStrahl commented 1 month ago

image

Ben-CO7 commented 4 weeks ago

I try using Print to Pdf, but the PDF ends up with strange font irregularities where some letters seem randomly bolded.

The old version of MM where the icons did show up in the PDF was 3.0.0.31. Is there a way I can revert my license back to that version?

RickStrahl commented 4 weeks ago

I'm pretty sure the old version won't work any differently. Nothing has changed in the way PDF output is generated in the Save To PDF feature as it uses the same tooling. Make sure if you Print to use Save as PDF, and not some PDF generation driver.

My guess what you think you used was actually printed with Print to PDF. The font issues might be due to the theme in use - if you print to pdf it'll use the active theme, while Save to PDF uses a separate theme (default Print To Pdf) which necessarily looks different. You can print to pdf with that same theme - you just have to switch to it before you print.

Old versions are available for download in the archives. Go to the download page and click on Archives.

You should try the latest preview - it has official WebView printing which will preserve fonts and most styling.

RickStrahl commented 2 weeks ago

Try this again with v3.5+ (preview still until next week) and open a new issue if this still doesn't work. It should work with the new PDF print engine.