This is a bit of a longshot, but maybe someone might have some ideas.
For reference - see Images don't display in PDF, a similar question.
I'm using the Htmlrenderer.PdfSharp library to create PDF files from HTML content. Everything works perfectly, with the sole exception of the images. They simply display a big red box.
The PDF works fine when running locally in debug mode, but not when deployed on the server. I've a small bit of extra information that might help - when executing the command to create the PDF:
using (MemoryStream ms = new MemoryStream())
{
var pdf = TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf(htmlContent, PdfSharp.PageSize.A4);
pdf.Save(ms);
res = ms.ToArray();
}
On the server, I get a few of the following errors:
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.dll
Running locally I don't get those errors. I have a feeling it has something to do with the .NET engine not being able to properly resolve the image URL. That being said, the image URL is fully-qualified. It is, however, behind HTTPS, if that helps.
I'm unable to go any further with my debugging. If anyone has any ideas, I'd love to hear them - even if it is just more places I can try hunting for clues.