Image not showing up when https forced (** update **)
Darren,
PDFCreator 2.2 is working just fine on local machine but with the same exact site running on a server under https, when we try to display the company logo in the header area of the PDF, the logo is blank.
Commenting out Response.AppendHeader("X-Pdf-Render","true"); we can see the xsl:fo output and it looks fine, but the image isn't appearing on the server running SSL.
This is actually happening on two different sites, so wondering if there's a pattern. Do you see anything amiss? The image is really there (you should be able to pull it down from where you are), so puzzled.
Even tried changing http to https in the fo:root tag, thinking the mixed-mode https/http issue might be part of it, but that caused a YSOD when it couldn't reach those sites as https.
Darren,
Just ran a test and removed the https: rewrite rule in IIS (required to force https connection) and the image does indeed show up on the production server when the requesting URL is plain http:
Image does appear:
http://www.lonestarchemical.com/products/polypropylene/homopolymer/lsc-1000/?altTemplate=LSCDataSheetPDF
So this appears to have something to do with the site being https-only. Aside from the [fo:root xmlns...] tag, is there anything in the Ferguson.Moriyama.pdf.dll that needs to know that all requests are https?
In the first line of the xsl:fo view, if i change the <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ibex="http://www.xmlpdf.com/2003/ibex/Format"> so that the xmlns:ibex reference is https, no error, but still no image.
If i change the xmlns:fo reference from http to https, it throws the following error: System.Exception: could not locate fo:root
Could it be that the site that you are trying to load the image from is secured with TLS 1.2 - whereas the default TLS version for the request would be 1.0 if you are on .net 4.5 ?
Image not showing up when https forced (** update **)
Darren, PDFCreator 2.2 is working just fine on local machine but with the same exact site running on a server under https, when we try to display the company logo in the header area of the PDF, the logo is blank.
Commenting out Response.AppendHeader("X-Pdf-Render","true"); we can see the xsl:fo output and it looks fine, but the image isn't appearing on the server running SSL.
This is actually happening on two different sites, so wondering if there's a pattern. Do you see anything amiss? The image is really there (you should be able to pull it down from where you are), so puzzled.
Even tried changing http to https in the fo:root tag, thinking the mixed-mode https/http issue might be part of it, but that caused a YSOD when it couldn't reach those sites as https.
The image is specified in the line that reads:
Darren, Just ran a test and removed the https: rewrite rule in IIS (required to force https connection) and the image does indeed show up on the production server when the requesting URL is plain http:
Image doesn't appear: https://www.lonestarchemical.com/products/polypropylene/homopolymer/lsc-1000/?altTemplate=LSCDataSheetPDF
Image does appear: http://www.lonestarchemical.com/products/polypropylene/homopolymer/lsc-1000/?altTemplate=LSCDataSheetPDF
So this appears to have something to do with the site being https-only. Aside from the [fo:root xmlns...] tag, is there anything in the Ferguson.Moriyama.pdf.dll that needs to know that all requests are https?
Thanks, Chuck
A little more data to help track it down:
In the first line of the xsl:fo view, if i change the <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ibex="http://www.xmlpdf.com/2003/ibex/Format"> so that the xmlns:ibex reference is https, no error, but still no image.
If i change the xmlns:fo reference from http to https, it throws the following error: System.Exception: could not locate fo:root
I can, however, open a separate browser window and browse to https://www.w3.org/1999/XSL/Format directly and not receive an error.
Could it be that the site that you are trying to load the image from is secured with TLS 1.2 - whereas the default TLS version for the request would be 1.0 if you are on .net 4.5 ?
We've seen similar issues elsewhere.
See here - https://blogs.perficient.com/2016/04/28/tsl-1-2-and-net-support/
Assuming that you are using .net 4.5 - you may need to have the following line of code in your template someplace:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
Darren, Bingo! You nailed it!
Specifying the 1.2 protocol per your recommendation above did the trick.
Appreciate your awesomeness! Thanks, Chuck
is working on a reply...