Welcome Guest Search | Active Topics | Sign In | Register

CSS stylings and images lost using RenderAsPDF in MVC 5 Options
ACYIT
Posted: Thursday, September 24, 2015 7:58:09 AM
Rank: Newbie
Groups: Member

Joined: 9/24/2015
Posts: 5
Using RenderAsPDF on an MVC 5 site. The site is only available publicly over https.

It was working fine until the weekend of 9/11/15 - 9/13/15. We believe it may be related to a Microsoft security fix or patch that was applied during normal MS updates that weekend.

Steps taken so far:
- Updated to latest version of EO.PDF
- Served up MVC page without RenderAsPDF attribute - css and images displayed properly
- Updated resource links in <head> to absolute https urls as a temporary fix

It appears as if the PDF generation is trying to get the css and image resources over http instead of https. When we put in absolute urls's for the resources (i.e. "https//abc.com/css/style.css" instead of "/css/style.css") the css and images load correctly.

Is there any way to force RenderAsPDF to get all contents of the page over https?
eo_support
Posted: Thursday, September 24, 2015 8:47:59 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

Please check HttpContext.Current.Request.Uri.Scheme in your code. At runtime we use this to create the "BaseUrl" for the depencency resources (images, CSS, JavaScript, etc). So if that property gives us http, then we will use http, if that property gives us https, we will use https.

You can override the automatic BaseUrl by explicitly setting HtmlToPdf.Options.BaseUrl in your BeforeConvertHandler. See here for more details:

http://www.essentialobjects.com/doc/eo.pdf.mvc.mvctopdf.renderaspdf_overload_1.aspx

Thanks
ACYIT
Posted: Thursday, September 24, 2015 11:12:32 AM
Rank: Newbie
Groups: Member

Joined: 9/24/2015
Posts: 5
Hello, thanks for the quick reply!

I have verified that the uri scheme is https. Do you have any other recommendations?
eo_support
Posted: Thursday, September 24, 2015 2:16:02 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

As far as we know, it is not possible that the converter would somehow choose to use http when the request is https. So the problem should not be caused by http.

There are a couple of other things you can check:

1. Check HtmlToPdf.Options.BaseUrl in your before converter handler as mentioned in the previous post. By the time this event handler is called, HtmlToPdf.Options.BaseUrl should have already been automatically set. It supposes to be https already. If it is not, then you can override this value in your handler;

2. Check the SSL version on your IIS. Currently the converter does not support TSL 1.2. So if your IIS is set to ONLY support TSL 1.2, then you will have problems. We are working on the new version that will support TSL 1.2 though;

Thanks
ACYIT
Posted: Friday, November 20, 2015 1:24:32 PM
Rank: Newbie
Groups: Member

Joined: 9/24/2015
Posts: 5
The problem is indeed SSL/TLS.

Do you have an ETA on when there will be TLS 1.1 and 1.2 support? Currently our HTML to PDF conversion over https is only working when SSL 3.0 and TLS 1.0 are enabled.
Rusty
Posted: Monday, February 22, 2016 7:28:53 PM
Rank: Newbie
Groups: Member

Joined: 8/1/2014
Posts: 2
Do you have an update on TLS 1.2 support?
eo_support
Posted: Monday, February 22, 2016 7:48:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Rusty wrote:
Do you have an update on TLS 1.2 support?


We will have a new release very soon that will support TLS 1.2.

Thanks!
Rusty
Posted: Monday, March 14, 2016 6:40:49 PM
Rank: Newbie
Groups: Member

Joined: 8/1/2014
Posts: 2
Just checking in on TLS 1.2 support.
eo_support
Posted: Tuesday, March 15, 2016 9:40:32 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

Please download the latest build from our download page. This build is based on Chromium V49 and should support TLS 1.2.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.