1 Reply Latest reply on Sep 29, 2009 11:13 AM by _Natasha_

    print graph as image

    Varun Bajaj (PHP) Level 1

      Hi all,




      Is it possible to print chart as an image. If yes then appreciate a sample





      I tried but not succeed with below code. Here myImg represents my graph.




      var printJob:FlexPrintJob = new FlexPrintJob(); if (printJob.start()) { var chartPrintViewObj:chartPrintView = new chartPrintView(); Application.application.addChild(chartPrintViewObj); var jpgSource:BitmapData = new BitmapData (myImg.width, myImg.height); var myImage:Bitmap = new Bitmap(jpgSource); //Set the print view properties.myPrintContainer chartPrintViewObj.width=printJob.pageWidth; chartPrintViewObj.height=printJob.pageHeight; chartPrintViewObj.printChartContainer.addChild(myImage); printJob.addObject(chartPrintViewObj); Application.application.removeChild(chartPrintViewObj);




      Thanks and warm regards,