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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

HTML with iframe to PDF WebKit

Thread ID:

Created:

Updated:

Platform:

Replies:

149245 Nov 19,2019 08:49 PM UTC Nov 22,2019 01:31 PM UTC WinForms 5
loading
Tags: PDF
Doug Simpson
Asked On November 19, 2019 08:49 PM UTC

Does anyone have an example of creating a PDF of an HTML page that has an iframe using c#?

Gowthamraj Kumar [Syncfusion]
Replied On November 20, 2019 08:33 AM UTC

Hi Doug, 

Thank you for using Syncfusion products. 

We have created a simple sample to convert the HTML file (with iframe) into PDF document using WebKit HTML converter. Kindly try the below sample in your end and let us know the result if it suites your requirement. Please find the sample and output document from below link, 

Please let us know if you need any further assistance on this. 

Regards, 
Gowthamraj K 


Doug Simpson
Replied On November 20, 2019 02:06 PM UTC

Thank you Gowthamraj. I am currently using a trial version of Syncfusion. We're evaluating Syncfusion components.  The attached is what I get when I run the code provided. Your code appears to use the .Net Framework, but we would prefer to use .Net Standard or Core. Is there a fully working trial version of the Syncfusion Essential PDF components?

Attachment: HtmlToPDF_c03adeec.zip

Gowthamraj Kumar [Syncfusion]
Replied On November 21, 2019 11:29 AM UTC

Hi Doug, 

Thank you for your update. 

We have created a simple sample to convert the HTML file (with iframe) into PDF document using WebKit in Net Core. Kindly try the below sample in your end and let us know the result if it suites your requirement. Please find the sample and output document from below link,  

Note: Yes, all the features are supported in both trial and license version.  

Please let us know if you need any further assistance on this. 

Regards, 
Gowthamraj K

Doug Simpson
Replied On November 21, 2019 01:48 PM UTC

Thank you Gowthamraj. I built an xunit test library yesterday with code similar to what you provided and was able to get it working. The iframe is PowerBI embedded and may be the issue. If the iframe source is a local file or epa.gov, then the PDF renders non-blank. If the iframe source is PowerBI embedded or a site like apple.com, then the PDF is blank.

Gowthamraj Kumar [Syncfusion]
Replied On November 22, 2019 01:31 PM UTC

Hi Doug, 

Thank you for your update. 

We have checked the conversion with powerbi and apple sites and the converter generates PDF document. We internally make use of Qt WebKit rendering engine for converting HTML to PDF. WebKit rendering engine preserves the output PDF document like how the input HTML file/URL is displayed on the WebKit based web browsers (safari), those sites are not loaded inside a iframes in web browser itself. The same behavior as replicates in our converter. We have attached a screenshot of the simple webpage view in safari browser for your reference. 

We have attached the documents with iframe for your reference.  

 

On further analysis about this loading issue, some websites (power bi, apple, yahoo etc.,) are does not allowed their site to displayed inside a iframes, for the purpose of protecting the security of information we entered in that website, the publisher of the site does not allow to displayed inside a frame.  

Please let us know if you need any further assistance on this. 

Regards, 
Gowthamraj K 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon