I am trying to convert an HTML string to PDF using Pechkin Synchronized (WkHtmlToPDF). Everything works fine regardless of one (transaction).
As part of the HTML line, I have an image tag that refers to a dynamically generated PNG file via SSL (see below for code). It just displays as an empty field in the output pdf file.
I checked the documents and included every option that I can think of, and saw links to WkHtmlToPDF, capable of supporting PNG format and extracting 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); }
Corresponding HTML that references the βmissingβ image
<img width="385" src="https://www.somehost.com/path/endpoint?type=somedata&height=140&width=2&data=000000000000000000">
I also tried to convert it simply and see if it helps, but unfortunately it is not:
<img width="385" src="https://www.somehost.com/path/endpoint?type=somedata&height=140&width=2&data=000000000000000000">
When I click the link directly through the browser and check the Content Length 1136 script reports, Content Type as image / png and the headers also mention WebSphere and Servlets.
After additional testing and assistance from the owner of the library, it seems that SSL is not a problem, its lack of extension.
source share