0 Replies Latest reply on Nov 6, 2009 7:21 PM by kevnug

    FlexPrintJobScaleType.SHOW_ALL

    kevnug

      Hello all,

       

      From what I've read and experienced Flex doesn't do printing very well....

       

      Nevertheless, I have the need to print a single page in an AIR app I'm creating.

       

      I've setup the 'print template' as a VBox with forms, etc and assign data to it upon creation:

       

      private function printOrder(jobVO:JobVO):void{

                          

                       var printJob:FlexPrintJob = new FlexPrintJob();

                      

                       if (printJob.start()) {

                            

                                 var j:JobForm = new JobForm();

                                 j.currentState = "print";

                                 j.jobVO = jobVO;

                      

                           addChild(j);

                           printJob.addObject(j, FlexPrintJobScaleType.SHOW_ALL);

                               

                           removeChild(j);

                           printJob.send();

       

                       }

                      

                     }

       

      All data gets populated correctly and the job is sent to the printer - however, even with the FlexPrintJobScaleType set to SHOW_ALL, the printout is consistently two pages on either OSX or Windows.

       

      From the ASDOCS:

      SHOW_ALL : String = "showAll"

      [static] Scales the object to fit on a single page, filling one dimension; that is, it selects the smaller of the MATCH_WIDTH or MATCH_HEIGHT scale types.

       

      Some people suggest using AlivePDF to generate a pdf - however, so far I have found no way to actually print the pdf without the user performing a manual second step.

       

      Does anyone have any advice to share?

       

       

      cheers