Welcome Guest Search | Active Topics |

Posting exportToPdf result to server
gerrit
#1 Posted : Saturday, November 1, 2014 5:18:53 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/1/2014(UTC)
Posts: 5
Man

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Hello. Is there any way to post exportToPdf result to server? For raster image post I can put $('#jqChart').jqChart('todataurl', 'image/png') output into a simple form input and post the form. Is there any way to to the same to post PDF export to server? Thanks!
Dragan
#2 Posted : Monday, November 3, 2014 8:55:35 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
We can give you our server export app, which is an ASP.NET Web Forms application, so you can export the images on your server and probably save them. Currently that's the way.
Best Regards,
Dragan Matek
jqChart Inc.
gerrit
#3 Posted : Monday, November 3, 2014 9:20:32 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/1/2014(UTC)
Posts: 5
Man

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Thanks for your answer, but it's not an option, as we run a simple tomcat web app.

Currently I'm using your API-access to canvas.toDataURL() feed the base64 result into a hidden form field and post it to the server, which then takes the field, decodes base64, converts the png to PDF, combines it with two overlay PDF's (one dynamic with captions and some text, the other static logo and footer) and return the whole thing as response to the post. The PDF is in total 150 kB, so small enough, it's fast, efficient and easily customizable for us. Resolution of the canvas images is not crisp but ok for print.

To improve the output quality I'd like to do the same thing with the client side jqChart-PDF $('#jqChart').jqChart('exportToPdf') instead of the rasterized canvas image. If you can send the PDF through the browser to the user, you must be able to encode it to base64 and return it by some js function call, or?
asmyatt
#4 Posted : Monday, November 3, 2014 3:53:01 PM(UTC)
Rank: Newbie

Groups: Registered, WebFormsChart
Joined: 6/12/2013(UTC)
Posts: 1

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
dragan wrote:
We can give you our server export app, which is an ASP.NET Web Forms application, so you can export the images on your server and probably save them. Currently that's the way.


Dragan, it would be great if you can provide that code. We have a similar need, and luckily our application is an ASP.NET Web Forms application. Please let me know if it is possible to get the code.
Thanks!
Dragan
#5 Posted : Tuesday, November 4, 2014 3:54:27 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
@asmyatt I've sent you our export app via email.

@gerrit "If you can send the PDF through the browser to the user, you must be able to encode it to base64 and return it by some js function call, or?"

- We'll check if we can do this and I'll let you know.
Best Regards,
Dragan Matek
jqChart Inc.
Users browsing this topic
Guest (2)
Forum Jump  
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.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.096 seconds.