We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

HtmlConverter with user and password?

Thread ID:

Created:

Updated:

Platform:

Replies:

96479 Sep 15,2010 01:52 PM Oct 4,2010 04:55 AM ASP.NET Web Forms (Classic) 8
loading
Tags: PDF
Daniel Blendea
Asked On September 15, 2010 01:52 PM

Hi,

I'm trying to use the HtmlConverter to convert an html page to pdf and I need to use authenticated acces.

I tried to set the Username and the Password of an HtmlConverter object or to use

html.Convert( url,
ImageType.Metafile,
(int)width,
-1,
AspectRatio.KeepWidth,
Username,
Password );

but all I get in the pdf is the login page.
I'm using version 8.303.0.21 of the suite.

How can I make it work?




Angappan G [Syncfusion]
Replied On September 16, 2010 06:59 AM

Hi Daniel,

Thank you for your interest in Essential PDF.

We are unable to reproduce the issue on our side. We suspect that you are trying to convert the web page supporting form based authentication, Essential PDF would support only the windows Authentication.

Please let us know if you have any queries.

Regards,
Angappan.



Daniel Blendea
Replied On September 17, 2010 04:28 AM

Indeed, I'm using Forms Authentication.

What about the overload that takes an html string?
I tried to use that one, but again is not working.

HtmlToPdfResult result =
htmlConverter.Convert( htmlPage, baseUrl,
ImageType.Metafile, (int)width, -1, AspectRatio.FitPageSize );

the htmlPage is a string which contains the whole html page.
the baseUrl is the url of the web application, like this:

http://localhost/MyApp.Reports.Web/

Any ideas why it might not work?
The samples are quite scarce...


Daniel Blendea
Replied On September 17, 2010 04:29 AM

I forgot to mention, all I get is a blank pdf.


Angappan G [Syncfusion]
Replied On September 20, 2010 09:34 AM

Hi Daniel,

The overload that takes HTML string and BaseUrl as argument converts the given html string that authenticates the given credentials if it the page uses Windows authentication. The Base URL parameter is used refer the tag in the head part of the HTML file, it is used to refer the resources that are referred using relative path with respect to the Base URL. Please refer to the sample for more details.

Please let us know if you have any queries.

Regards,
Angappan.




96479_3088e30f.zip

Daniel Blendea
Replied On September 20, 2010 12:21 PM

Hello Angappan,

My code looks pretty much like the sample you provided, except for the fact that is a web app.

But it still doesn't produce any usable pdf.
As I have previously said, the html sent to the htmlConverter.Convert(html, baseUrl) method is retrieved succesfully by another method and the baseUrl path is publicly accesible.

If it were an authentication issue, the generated pdf would be the login page.

Is there any logging setting that I can activate to find more information about this problem?




Angappan G [Syncfusion]
Replied On September 22, 2010 12:54 AM

Hi Daniel,

Sorry for the delay in getting back to you.

We are unable to reproduce the issue on our side, could you please provide us the simple sample to reproduce the issue on our side. This will help us to investigate further.

Please let us know if you have any queries.

Regards,
Angappan.


Daniel Blendea
Replied On September 28, 2010 10:00 AM

Unfortunately, I've already wasted too much time with these products and waiting for answers on this forum.

The only solution was to quit using the Syncfusion components.


Pravin Joshua D [Syncfusion]
Replied On October 4, 2010 04:55 AM

Hi Daniel,

Sorry for the possible inconvenience caused.

We are unable to reproduce the issue.Could you please report the issue with your sample through Direct Trac Developer Support Systemhttps://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Please let us know if you have any other questions.

Regards,
Pravin Joshua D


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;