Closed Ben-CO7 closed 2 weeks 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.
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.
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
Closer to HTML Output
The WebView produces much closer PDF output to the original HTML in the previewer. This is due to the newer Chromium engine used in the WebView including support for media content, and it's dymnamic rendering of content so script rendered output is captured (like code colored code snippets for example).
Significantly faster rendering
WebView rendering is considerably faster than wkhtmltopdf for large documents. This is due to the much newer and more performant Chromium engine - same used in the previewer or the latest Chromium version installed with the WebView.
Print Preview matches output closely
The print previewer and output generated by the WebView PDF generation use the same engine, hence you can expect the same output.
WebView Disadvantages
No header or Footer Support
I have not been able to make the WebVIew engine (or the rendered printed HTML document) to render headers or footers. Still looking into this but at the moment this does not look possible.
Page Size limitations (will be fixed later)
Currently page sizes can't be adjusted for PDF documents so it uses default page sizing for your browser and locale.
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.
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?
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.
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.
When using Save to PDF, the icons (that show in the preview) disappear in the PDF.
Markdown
Preview
PDF
This wasnt happening until I got the license and it upgraded MM to the latest version.