PDF Generated with Wingings Font
When I generate a pdf and upload it to azure blob storage, the html string I'm passing in is somehow being turned into Wingdings when I generate the PDF.
var html = "<p>Normal HTML Content</p>";
// Create CarrierHQ pdf from HTML
var pdf = VetCV.HtmlRendererCore.PdfSharpCore.PdfGenerator.GeneratePdf(html, PageSize.A4);
// ** Removing this doesn't help **
// Download and append Aon pdf to CarrierHQ pdf
var appendBlob = container.GetBlockBlobReference("append.pdf");
await using (var ms = new MemoryStream())
{
await appendBlob.DownloadToStreamAsync(ms);
var appendPdf = PdfReader.Open(ms, PdfDocumentOpenMode.Import);
foreach (PdfPage page in appendPdf.Pages)
{
pdf.AddPage(page);
}
}
// Upload final document to Azure
using (var ms = new MemoryStream())
{
pdf.Save(ms);
await chqBlob.UploadFromStreamAsync(ms);
}
The weirdest part is when I copy-paste the wingdings text into Word, it pastes in English.....
Interestingly, when I run the server and generate the pdf on Windows, it works fine. When I run it on Linux/Mac, it produces wingdings icons instead of text.
Our production hosting is on Linux, so this package won't work for us unless it supports Linux.
Strangely enough, it generates in greek for me on a mac, did you find a solution?
That is hilarious. We ended up going with IronPDF. It's expensive, but we needed a solution quick.
I know this is an old thread but I encountered this on my Mac and after a bit of troubleshooting I was able to fix it. The issue is the location of fonts on my OS is actually /System/Library/Fonts/Supplemental not the location that the default font resolver expects /Library/Fonts. That is the location where all *.ttf fonts are saved. I am running MacOS 12.6 Monterey. So to resolve this issue I simply created a bunch of symbolic links in the /Library/Fonts location pointing to the actual location of the ttf fonts. That solved the issue for me. Perhaps default font resolver can become a bit more robust and if it does not find any ttf fonts in the default location try a couple of other options.