Welcome Guest Search | Active Topics | Sign In | Register

HTML page with JS Not exported Options
Deepak
Posted: Thursday, July 30, 2015 4:00:10 AM
Rank: Member
Groups: Member

Joined: 7/30/2015
Posts: 12
HI Friends,

We are using EO PDF, and facing one of the issue that is our page contains HTML and JS(JQ data grid). This page has Chart created by HighChart Js.

When i trigger export, I can only export the HTML elements on the page, Jq data table and HighCharts are not coming. I felt that it was Browser Render time issue but i have increased the time for the Browser rendering but it remains same(No ajax calls triggered).

Could you please help me out to resolve this issue. Would be very appreciable.

Thanks
eo_support
Posted: Thursday, July 30, 2015 9:19:54 AM
Rank: Administration
Groups: Administration

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

Do you have the page online? If so you can PM us the page Url so that we can take a look here.

Thanks!
Deepak
Posted: Friday, July 31, 2015 9:40:35 AM
Rank: Member
Groups: Member

Joined: 7/30/2015
Posts: 12
HI Thanks for the reply,

Unfortunately I don't have that page online because it is under development. One thing which was when i pass the View which contains the Js data is not render while export.
Could you please provide some help on the same.

Thanks & Regards,
Deepak
eo_support
Posted: Friday, July 31, 2015 11:36:09 AM
Rank: Administration
Groups: Administration

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

There isn't much we can tell you without being able to see what's going on. One thing you can check is this:

http://www.essentialobjects.com/doc/web/aspxtopdf/troubleshoot.aspx

Thanks
Deepak
Posted: Wednesday, August 5, 2015 10:41:19 AM
Rank: Member
Groups: Member

Joined: 7/30/2015
Posts: 12
Hi @eo_support

Let me explain my problem in a better way and hope this will help you.

I am using HighCharts JS library to generate the charts on my MVC View named "ChartsPageView".
Now the Highcharts JS internally calls an Action method to get the data required to generate the chart. (this data is in JSON format)
The chart generated by this JS is in SVG format. Also note that all the work to generate the chart's image is done on the client side. i.e. I have placed a div container in my MVC view which is filled by the HighChart JS methods on load.

Now I have added a PDF button on the same page so that user can export the page with charts in PDF format.

On click of the PDF button I am calling another Action Method which has the following code.

var doc = new PdfDocument();
string report=RenderPartialView("ChartsPageView",model);// this will return the view in html string format
var stream = new MemoryStream();
HtmlToPdf.Options.NoLink = true;
HtmlToPdf.Options.RepeatTableHeaderAndFooter = false;
HtmlToPdf.Options.BaseUrl = baseUrl;
HtmlToPdf.Options.OutputArea = new RectangleF(0.5f, 0.5f, 7.5f, 10f);
HtmlToPdf.Options.MinLoadWaitTime = 1800;
HtmlToPdf.ConvertHtml(report, doc);
doc.Save(stream);
stream.Position = 0;

But I found that the PDF generated here doesn't consist of the chart which was generated by the HighChart JS.

What I feel is when we call the RenderPartialView() method the chart is not being generated by the HighChart JS.
So my question is , does EO.PDF invokes the HighChart JS's methods and render the SVG image.
Please provide your valuable feedback on this.

Thanks.
eo_support
Posted: Wednesday, August 5, 2015 8:59:06 PM
Rank: Administration
Groups: Administration

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

We run all the JavaScript code the same way as it would in a regular browser. You can think EO.Pdf as a web-browser --- the only difference is it renders to PDF instead of to the screen.

In order for us to look into the issue for you, you need to disregard all your other logic first --- we don't care how you generated your HTML. If you give us X HTML and it renders Y in a regular browser but Z in EO.Pdf, then create a test app that demonstrates exactly that and send it to us. We will then look into it and tell you what's wrong. For everything else you will need to resolve it on your end.

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.