3 Replies Latest reply on May 17, 2010 10:04 PM by BhaskerChari

    Print an image

    Zolotoj Level 3

      Is it possible to print an image to local printer  from Flex apps?

       

      Thanks

        • 1. Re: Print an image
          BhaskerChari Level 4

          Yes its defenitely possible to print an image in Flex...Using FlexPrintJob or PrintJob class.

           

          private function printGraph():void
          {
                          var printJob:FlexPrintJob = new FlexPrintJob();
                         
                          if (printJob.start() != true) return;
                         
                          try
                          {
                          
            
                 printJob.addObject(yourImageId, FlexPrintJobScaleType.MATCH_WIDTH);
                               printJob.send();
                          }
                          catch(error:Error)
                          {
                                trace("Error: " + error.message);
                          }
           
          }

           

          You can refer to Flex help manual for more details

           

          Please mark it as answered if it helped you.

           

          Thanks,
          Bhasker Chari.S

           

           

           

           

          • 2. Re: Print an image
            Zolotoj Level 3

            Can a print job be sent to a specific printer to suppress Printer Dialog?

             

            Thanks

            • 3. Re: Print an image
              BhaskerChari Level 4

              No, you can't supress the printDialog box as soon as you call printJob.start() the OS print dialog box opens and if you click ok then the printjob will be sent to printer for printing and if you click cancel then nothing happens and the printjob is canceled...

               

              I mean to say the print dialog opens up compulsorily...

               

              Thanks,

              Bhasker Chari.S