1 Reply Latest reply on Nov 5, 2012 11:26 PM by Flex harUI

    printing a large image on multiple pages

    deepinus

      Is there a way to print a large image on multiple pages using flexprintjob? I have aan image which spans across multiple pages but when i add it to the flexprint job, it just prints the first page and remaining image does not show up. Here is the code.

       

       

      var printJob:FlexPrintJob = new FlexPrintJob();

                                    printJob.printAsBitmap = true;

       

                                    if (printJob.start() == false)

                                              return;

       

      targetUI=resourceChart;

      drawUISnapshot(targetUI);

      image.width=printJob.pageWidth;

      image.height=printJob.pageHeight;

       

                                    image.validateNow();

       

       

                                    addChild(image);

       

                                    validateNow();

                                    printJob.addObject(image);

                                    removeChild(image);

                                    printJob.send();

       

       

       

       

      private function drawUISnapShot(target:UIComponent):void{

       

                                              var UIBData:BitmapData = new BitmapData(target.width,target.height);

       

                                              var UIMatrix:Matrix = new Matrix();

                                              UIMatrix.scale(2,2);

       

                                              UIBData.draw(target, UIMatrix);

       

                                              source = new Bitmap(UIBData);

       

       

                                              image=new Image();

                                              image.source=this.source;

       

       

                                              invalidateDisplayList();

       

       

       

       

                }