I'm trying to convert an HTML string to PDF using Pechkin Synchronised (WkHtmlToPDF). Everything works perfectly apart from one (deal breaking) part.
As part of the HTML string I have an Image tag that references a dynamically generated PNG file over SSL (See below for code). It simply appears as a blank box in the output pdf.
I've checked the docs and turned on every option I can think of and have seen references to WkHtmlToPDF being able to support PNG format and pull data from SSL'd sources.
byte[] pdf = new Pechkin.Synchronized.SynchronizedPechkin(
new Pechkin.GlobalConfig()).Convert(
new Pechkin.ObjectConfig()
.SetLoadImages(true)
.SetPrintBackground(true)
.SetScreenMediaType(true)
.SetCreateExternalLinks(true), html);
using (FileStream file = System.IO.File.Create(@"C:\TEMP\Output.pdf"))
{
file.Write(pdf, 0, pdf.Length);
}
Relevant HTML that references the "missing" image
<img width="385" src="https://www.somehost.com/path/endpoint?type=somedata&height=140&width=2&data=000000000000000000">
Also tried converting the &'s to just &'s to see if that helps like so but sadly it didnt:
<img width="385" src="https://www.somehost.com/path/endpoint?type=somedata&height=140&width=2&data=000000000000000000">
When I hit the link directly through the browser and inspect fiddler reports Content Length 1136, Content Type as image/png and the headers also mention WebSphere and Servlets.
After further testing and help from the owner of the library it seems that SSL is not the problem, its the lack of extension.