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. Image for the cookie policy date
close icon

HtmlConverter with user and password?

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?




8 Replies

AG Angappan G Syncfusion Team September 16, 2010 10:59 AM UTC

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.




DB Daniel Blendea September 17, 2010 08:28 AM UTC

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...



DB Daniel Blendea September 17, 2010 08:29 AM UTC

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



AG Angappan G Syncfusion Team September 20, 2010 01:34 PM UTC

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


DB Daniel Blendea September 20, 2010 04:21 PM UTC

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?





AG Angappan G Syncfusion Team September 22, 2010 04:54 AM UTC

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.



DB Daniel Blendea September 28, 2010 02:00 PM UTC

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.



PJ Pravin Joshua D Syncfusion Team October 4, 2010 08:55 AM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon