0

I am trying to implement the example provided on the following link http://www.amcharts.com/tutorials/export-charts-advanced/ and its working fine. In the sample PDF layout they a have predefined image for logo, this is a base64 PNG image. my problem is that i have taken and saved the logo image from user to be used in reports.Image is on a specific known location at server which might be accessed through a URL in my java script. but how can i access this image and reference it in my PDF layout so that it can be used as an header or logo image in my PDF reports. whether there's a method to provide the image URL instead of providing a static base64 image data or do i need to write a function to to get image from server and convert it to a base64 image data and assign it to the logo attribute in the PDF layout. please watch the sample layout at following link http://extra.amcharts.com/support/export/report/layouts/layout_1.js

in the above link i am concerned about the last part "predefined images" i want to get this image from my server with a URL or with any suggested method.

Kindly help.

Thank you.

umer
  • 1,196
  • 1
  • 14
  • 33
  • You could use something like this http://stackoverflow.com/questions/6150289/how-to-convert-image-into-base64-string-using-javascript Look at the second answer. – Rafael Herscovici Dec 21 '15 at 10:37
  • could you please check the sample PDF layout , i have provide a link to that , in the last portion there is "predefined images attribute" how do i assign the value to the "logo" attribute ? – umer Dec 21 '15 at 10:53
  • my image file is inside the upload folder in root directory with the name "logo.png" – umer Dec 21 '15 at 10:55
  • i have tried implementing the solution at following link but it returns me a Incomplete or corrupt PNG file – umer Dec 21 '15 at 12:14

0 Answers0