ASPOSE PDF Integration With amcharts

Hi,

I am using Amcharts for analytical reporting and would love to integrate those Amcharts graphs in PDF’s too.

Any ideas how should I do it?
Converting through HTML TO PDF Failed in my regard (refer to Issue While Converting HTML File to PDF - #4 by Farhan.Raza)

Is there any way through which I can achieve my above requirements using Native API’s?

  • Kushagra

@kushagra93

Thanks for contacting support.

Amcharts use Javascript to render charts and graphs in HTML Canvas. Unfortunately, we already have logged several issues regarding Javascript rendering while PDF generation and they are pending for investigation. Would you please share some source HTML files which use Amcharts JS, we will test the scenario by converting them into PDF and proceed after checking results.

Hi @asad.ali
Apologies for the delayed response, please find the attached html file.TestReport123_2018-08-15 12-30-01.zip (7.2 KB)

@kushagra93

Thanks for sharing sample HTML file.

We have observed an Exception of ('Failed to parse URL') while converting your HTML into PDF using following code snippet.

Aspose.Pdf.HtmlLoadOptions objLoadOptions = new Aspose.Pdf.HtmlLoadOptions();   
objLoadOptions.PageInfo.Margin.Bottom = 0;
objLoadOptions.PageInfo.Margin.Top = 0;
objLoadOptions.PageInfo.Margin.Right = 0;
objLoadOptions.PageInfo.Margin.Left = 0;
objLoadOptions.PageInfo.Height = PageSize.A4.Width;
objLoadOptions.PageInfo.Width = PageSize.A4.Height;
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(dataDir + "TestReport123_2018-08-15 12-30-01.html", objLoadOptions);
doc.Save(dataDir + "SamplefromHtml.pdf");

We have logged an issue as PDFNET-45242 in our issue tracking system and will further investigate this in details. Regarding JavaScript rendering while HTML to PDF conversion, an investigation ticket as PDFNET-42361 was already logged in our issue management system and it has also been linked with this post. As soon as we have some definite updates regarding logged tickets, we will let you know. Please spare us little time.

We are sorry for the inconvenience.

@asad.ali Sure, no worries :slight_smile:

Just wanted to check whether Native API’s can fulfill my requirements??

Best Regards,
Kushagra Sahni

@kushagra93

Thanks for your feedback.

As soon as requested feature is available, we will surely inform you.

The issues you have found earlier (filed as PDFNET-45242) have been fixed in Aspose.PDF for .NET 22.2.