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.

Blank PDF is generated when converting windows authenticated web page (html file)

Thread ID:

Created:

Updated:

Platform:

Replies:

103817 Jun 1,2012 05:02 AM Dec 9,2012 11:18 PM ASP.NET Web Forms (Classic) 6
loading
Tags: PDF
hatallia
Asked On June 1, 2012 05:02 AM

Dear Support,

I am using 9.103.0.24 version of Syncfusion to render PDF from a web page. Page is HTML file located in the SharePoint document library. Windows authentication is used to access SharePoint site. There are two servers in the SharePoint farm (windows 2008, IE 8), and not always but sometimes PDF is generated as a blank page on one of the server. 

I could not find any error logs but it seems like HtmlConverter cannot get images by provided url. Below is a method I use:

htmlconverter.FromString(htmlData, baseUrl, ImageType.Metafile, (int)width, -1, AspectRatio.KeepWidth)

If I specify username and password in this method explicitly, everything works fine. However, why does it work like this? Can HtmlConverter just use the default credentials (current user has enough permissions to access the web page)? Is there any workaround not to pass username/password and get it working?

Thanks in advance,
Kind regards,
Natallia



hatallia
Replied On June 4, 2012 09:00 AM

Any ideas how to get PDF generated from a web-authenticated page using Default credentials (not using username/password explicitly)? 

Looking forward to your reply.

Geetha M [Syncfusion]
Replied On June 5, 2012 05:42 AM

Hi,

Thank you for your interest in Syncfusion products.

HtmlConverter does not make use of Default Credentials. It internally makes use of MSHTML.dll (IE rendering engine) and when every time a conversion is initiated, it will create a new instance of WebBrowser control which is equivalent to opening the URL in new browser window in IE.

However, you may work around this in your application as explained in the link below. You may edit the url of the webpage and append it along with credentials.


Please try this and let me know if you have any questions.

Regards
Geetha

hatallia
Replied On June 5, 2012 08:09 AM

Geetha M,

Many thanks to your reply. I will use this workaround.

The strange thing is during my tests HtmlConverter mostly generated a blank PDF file and sometimes it did generate a correct one - even without appended credentials. That is why I asked this question.

Geetha M [Syncfusion]
Replied On June 6, 2012 12:31 AM

Hi,

Thank you for the update.

Please let us know if you have any other questions.

Regards

Geetha

Maroof Ahmed
Replied On December 7, 2012 06:47 AM

I am also facing the same problem.

Can you please let me know what version of IE is required on server.

 

Regards,

Maroof


Geetha M [Syncfusion]
Replied On December 9, 2012 11:18 PM

Hi Maroof,

Thank you for your interest in Syncfusion products.

HTMLConverter works with Internet Explorer versions 6 and later. Could you please try the workaround stated above and if you still reproduce the problem, send us the code snippet?

Regards

Geetha


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.

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.

;