Welcome Guest Search | Active Topics | Sign In | Register

EO.Pdf.HtmlToPdfException: Failed to convert Url Options
Martin
Posted: Friday, September 6, 2013 6:10:45 AM
Rank: Newbie
Groups: Member

Joined: 6/12/2013
Posts: 4
I've have been using EO.PDF successfully on my development web server for some time.
Details:

Microsoft Windows Server 2008 R2 Standard
IIS 7.5

I have just published by ASP.NET web application to a production server:

Microsoft Windows Server 2003 Standard Edition Server Pack 2
IIS 6.0

The web application is set up to use Windows Authentication enabled and all other authentication methods disabled.

The Web Page conversion works perfectly on the development web server but on the production web server I get the error:

EO.Pdf.HtmlToPdfException: Failed to convert Url 'http://myproductionserver/scorecard/Scores/Scores.aspx?SupplierCode=9495&PeriodFrom=201304&PeriodTo=201306&PDF=True'.(1102:This is not a valid HTML document.) at EO.Pdf.Internal.de.a(String A_0, Boolean A_1) at EO.Pdf.Internal.de.b(HtmlToPdfOptions A_0, String A_1, Boolean A_2) at EO.Pdf.Internal.de.a(bs A_0) at EO.Pdf.Internal.lr.c.a(Byte[] A_0)


When I configure the production server to use Anonymous Access the conversion to PDF works without error.

However I don't want Anonymous Access on the production webserver web application, the application needs to validate the windows user. Is there something in the setup/config files that IIS 6 requires that IIS 7.5 does not require to enable EO.Pdf to work with only with Windows Authentication.

I'm using EO.Pdf.dll File version 5.0.22.2. (2013)

Thanks.
eo_support
Posted: Friday, September 6, 2013 9:13:56 AM
Rank: Administration
Groups: Administration

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

EO.Pdf uses the calling thread's user context to authenticate with the server. So for example, if you run EO.Pdf interactively, then the current logged in user will be used to authenticate with the server. If you run EO.Pdf inside IIS, then the IIS user context will be used to authenticate with the server. You will want to check the calling thread's user context and see if that user has sufficient permission to authenticate with your server. As long as the calling thread's user context has sufficient permission, it should work.

Thanks!
Martin
Posted: Friday, September 6, 2013 10:01:23 AM
Rank: Newbie
Groups: Member

Joined: 6/12/2013
Posts: 4
Hi

The issue is that the application works fine with Windows Authentication enabled on Microsoft Windows Server 2008 R2 Standard
IIS 7.5
but not on Microsoft Windows Server 2003 Standard Edition Server Pack 2
IIS 6.0

Can you be a little more clearer why there should be the error when the code to generate the PDF is the same?

Is there a set up issue for Microsoft Windows Server 2003 Standard Edition Server Pack 2 IIS 6.0 that I'm missing to ensure the PDF generation works.

Thanks
eo_support
Posted: Friday, September 6, 2013 11:00:57 AM
Rank: Administration
Groups: Administration

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

We are not expert on IIS or Windows administration, so you may want to consult your server administrator on that. From our product point of view, the user context of the calling thread is all that matters.

Thanks!
Martin
Posted: Friday, September 6, 2013 11:15:09 AM
Rank: Newbie
Groups: Member

Joined: 6/12/2013
Posts: 4
ASP.NET C# Code extract:

sUser = System.Threading.Thread.CurrentPrincipal.Identity.Name;

String thisPage = HttpContext.Current.Request.Url.AbsoluteUri+"&PDF=True";
PdfDocument docPDF = new PdfDocument(); ;

HtmlToPdf.ConvertUrl(thisPage, docPDF);

docPDF.Save(pdfName);

The value of sUser is a valid domain user, the windows log on user. Is this calling thread's user context you refer? In this case can you further look into the error reported:

EO.Pdf.HtmlToPdfException: Failed to convert Url 'http://myproductionserver/scorecard/Scores/Scores.aspx?SupplierCode=9495&PeriodFrom=201304&PeriodTo=201306&PDF=True'.(1102:This is not a valid HTML document.) at EO.Pdf.Internal.de.a(String A_0, Boolean A_1) at EO.Pdf.Internal.de.b(HtmlToPdfOptions A_0, String A_1, Boolean A_2) at EO.Pdf.Internal.de.a(bs A_0) at EO.Pdf.Internal.lr.c.a(Byte[] A_0)

And explain why it is being generated?

Thanks
eo_support
Posted: Friday, September 6, 2013 11:29:28 AM
Rank: Administration
Groups: Administration

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

Your code looks fine. You may want to run a package monitor to see exactly what your web server is sending back to to the converter. Maybe that will reveal the exact reason why the converter rejects the document.

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.