4 Replies Latest reply on Feb 26, 2008 5:51 PM by RT2008

    Charts and PDF

    RT2008
      I am a complete newbie to Flex (have used some flash before). I am evaluating Flex 3 for charting. I wanted to know how does one create a PDF (on the server) that is an exact representation of a chart that the flex charting creates in the browser client? Are there APIs one can use on the server to create such a PDF?
      Does one have to buy "LiveCycle PDF generator" just for this feature?
      Thanks in advance.
        • 1. Re: Charts and PDF
          jylaxx Level 1
          If you want an exact reproduction of the displayed chart you can capture the display and send it to the server as a png or jpeg file. API for creating the PDF file depends of the server you use. Flex is only for the client side.
          exemple :
          var bmp : BitmapData = new BitmapData ( chart.width, chart.height ) ;
          bmp.draw ( chart ) ;
          var png : ByteArray = PNGEncoder.encode( bmp ) ;
          // here send png to your server....

          Have a look to alivePDF which can create a PDF file from Flex on the client side.
          • 2. Re: Charts and PDF
            RT2008 Level 1

            However, what if there is no displayed chart for a particular data set on the client.
            For example: Google Analytics displays the charts (they are using flex I am guessing). Plus, they also have a way to schedule sending these reports in email.
            Now, when these reports are generated (at some later time) its all pure server side code. I am looking to solve this scenario.

            Thanks
            • 3. Re: Charts and PDF
              jylaxx Level 1
              Well Flex charts are components made to be interactive. I doubt that a server side solution implements the exact same visual aspect chart, but may be...
              If you choose Flex to generate server side reports including charts, I think you are on the wrong road.
              • 4. Re: Charts and PDF
                RT2008 Level 1

                hmm .. no I think you misunderstand me.

                1) I do want client (browser based) interactive flex charting.
                2) However, I also want to be able to generate offline - server side reports in PDF that can be emailed - which should look - <b>as if </b> - a snapshot of the chart on the client was taken.

                Google Analytics is doing it. They have live charts plus offline scheduled emailed reports containing snapshots of these charts. I dont know if they have some sort of a client emulation on the server side or something. I dont think they are creating separate images on the server - they are somehow taking a snapshot of the flex app on the server side in an image and to a PDF and then emailing that.