[ 7 posts ]

Antoine

  • Username: Grinn
  • Joined: Tue May 22, 2012 7:03 am
  • Posts: 17
  • GitHub: Grinn
  • Gists: Grinn
  • Offline
  • Profile
Tags:

Exporting YUI3 charts in PDF

Post Posted: Wed Jun 13, 2012 3:50 am
+0-
Hi,

I am actually using YUI 3.5.1 charts and YUI 2.8 dataTable on a web page, into a J2EE application without .HTML page. (I use .jsp / .java / .js).

I would need to export this page, containing YUI, to a PDF.
Do you have an idea of how I could do that ?

I guess that if I can transform my charts and dataTable into images and treat this image on the server side, it would be easy to then make a .pdf using iText, for exemple.

But how to transform YUI components into simple images ?

Thank you

Alberto Santini

YUI Contributor

  • Offline
  • Profile
Tags:

Re: Exporting YUI3 charts in PDF

Post Posted: Wed Jun 13, 2012 4:20 am
+0-
Hello Antoine.

I think there is not a built-in solution in YUI.

You may give a look at the following stackoverflow thread:
http://stackoverflow.com/questions/9238 ... pg-png-pdf

Hope that helps,
IceBox

Antoine

  • Username: Grinn
  • Joined: Tue May 22, 2012 7:03 am
  • Posts: 17
  • GitHub: Grinn
  • Gists: Grinn
  • Offline
  • Profile

Re: Exporting YUI3 charts in PDF

Post Posted: Thu Jun 14, 2012 12:49 am
+0-
Thank you for your answer Alberto!

I'm not sure I am really understanding the post you link though.
Is there a simple way to transform YUI chart and dataTable into images ?

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: Exporting YUI3 charts in PDF

Post Posted: Thu Jun 14, 2012 12:56 am
+0-
Hello Antoine.

It seems there is not a built-in solution in YUI to export the charts in PDF.

Stackoverflow users suggested in that thread a few tools.

Of course your mileage may vary.

Regards,
IceBox

Antoine

  • Username: Grinn
  • Joined: Tue May 22, 2012 7:03 am
  • Posts: 17
  • GitHub: Grinn
  • Gists: Grinn
  • Offline
  • Profile
Tags:

Re: Exporting YUI3 charts in PDF

Post Posted: Fri Jun 15, 2012 2:35 am
+0-
As you can see I am not an experienced developper. :)

I don't see how transforming a html 5 canvas into a pdf is similar to my problem.
If you have the patience to give my a track about it, I would be please though. :)

Thank you.

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: Exporting YUI3 charts in PDF

Post Posted: Fri Jun 15, 2012 4:10 am
+0-
Hello Antoine.

As stated in the docs [1], based on device and browser capabilities, Charts leverages SVG, HTML Canvas and VML to render its graphical elements.

(That means a chart may be a canvas).

An example I found in that thread how to convert an image it is canvas2image [2].
I suppose there are other tools converting from SVG or VML.

I gave you a general starting point because the solution depends on the app architecture and it is not related directly to YUI.

Generally speaking, your approach may be feasable: I mean, creating on the frontend an image, transfering it to the server side and processing it to a pdf file.

However, maybe, the roundtrip would be shorter if the pdf would be generated directly on the server side.

My two cents,
IceBox

[1] http://yuilibrary.com/yui/docs/charts/
[2] http://www.nihilogic.dk/labs/canvas2image/

Antoine

  • Username: Grinn
  • Joined: Tue May 22, 2012 7:03 am
  • Posts: 17
  • GitHub: Grinn
  • Gists: Grinn
  • Offline
  • Profile

Re: Exporting YUI3 charts in PDF

Post Posted: Fri Jun 15, 2012 4:23 am
+0-
That's great thank you for your answers!
  [ 7 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
cron