Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Converting Open Flash Charts to an Image.

by tmharish (Friar)
on Apr 04, 2010 at 05:52 UTC ( [id://832680]=perlquestion: print w/replies, xml ) Need Help??

tmharish has asked for the wisdom of the Perl Monks concerning the following question:

Hi I have been trying to find a way to convert an flash chart created using Open Flash Chats into an image.

Motivation

A web application that I am working on uses Open Charts to display several graphs and I want to provide the user with the option to download a PDF containing the displayed data. My current approach is to convert the flash object into an image before then creating a pdf using LaTeX (The look of the pdf is fairly important).

What I have tried so far:

I have tried several methods to download the flash file. Unfortunately the file that I end up with is always the file that Open Charts provides. I understand that the Open Charts swf file takes certain arguments and creates the necessary chart but I don't know how to make this happen (out side of the browser that is).

Here is the Perl Flash Charts library.

Here is a discussion on creating an image. Unfortunately this and this only provide Jana script based solutions. To achieve what I require I need a solution that can be run purely on the server.

I tried to do this by finding a way to execute JS through Perl. I have so far tried Java.pm and Java::Import. Although I am able to get some basic examples to run I am totally at a loss when it comes to running jquery and Open Charts through these modules.

Could someone please help out?

  • Comment on Converting Open Flash Charts to an Image.

Replies are listed 'Best First'.
Re: Converting Open Flash Charts to an Image.
by moritz (Cardinal) on Apr 04, 2010 at 07:03 UTC
    The Open Flash Chart homepage has some bits about Perl - was there nothing helpful in there?
    Perl 6 - links to (nearly) everything that is Perl 6.
      Hi Moritz

      As far as I understand those files are for use in Perl CGI scripts to generate the Open Charts ... They are what I am using for my front end.

      That is unless I have missed something.

Re: Converting Open Flash Charts to an Image.
by Anonymous Monk on Apr 04, 2010 at 06:59 UTC
        Turns out that may not be possible though

        Its possible, its just more work :)

      Stupid mistake on my part.

      Trying Spider monkey now

Re: Converting Open Flash Charts to an Image.
by hossman (Prior) on Apr 05, 2010 at 02:20 UTC

    Spending a lot of time figuring out how to execute javascript on your server isn't really going to help you -- all the javascript does is instruct the Flash object to generate the image, and POST the binary data to the webserver, so executing it on the server doesn't do any good unless you are also executing the flash on your server

    Frankly, if you goal is that the user can trigger PDF generation (from the browser), then why don't you just use this same javascript to tell the Flash object to post the raw image back to your server, and then when your server gets the entire image, it can do whatever PDF generation it wants with it.

    The Javascript hook provided by the OpenFlashChart API even has a callback mechanism so you can trigger a download (or a redirect to a download) of the generated PDF.

      Hi hossman

      Thanks for the great idea! Managed to implement it and it works perfectly!

        mmmm, sory for my english, but I don't understand what is last solution.???
        hi!! tmharish, i need to do something like this, can you tell me how you solve the problem?, cause i dont know what mean "debug" at the Open Flash Chart API,:S, thaks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://832680]
Approved by McDarren
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-04-18 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found