7 Replies Latest reply on Dec 23, 2011 10:47 PM by Flex harUI

    Print error

    devInterama

      Hello,

       

      I'm trying to print and i'm getting the following error:

       

      Error #2055: The print job could not be started.
      

       

      The code:

       

      try
      {
           var printJob:FlexPrintJob = new FlexPrintJob;
      
           if(printJob.start())
           {
                printJob.addObject(uiCanvas, FlexPrintJobScaleType.SHOW_ALL);
                printJob.send();
           }
      } catch(error:Error) { trace('# print error', error) }
      

       

      Help

        • 1. Re: Print error
          Flex harUI Adobe Employee

          Make sure that code only runs once.  Try a simpler test case and use PrintJob.

          • 2. Re: Print error
            devInterama Level 1

            Greetings dear Flex harUI,

             

            That code runs once. I tried a Flex project test case and it worked there. But in a mobile project test -- as my project -- it doesnt. What now? 

            • 3. Re: Print error
              Flex harUI Adobe Employee

              Hmm.  Maybe try divide and conquer to see if you can strip down your app until the error goes away.

              • 4. Re: Print error
                devInterama Level 1

                Greetings,

                 

                I just started an empty mobile project, there is nothing to strip down.

                 

                 

                <?xml version="1.0" encoding="utf-8"?>
                <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
                                                 applicationComplete="omg()">
                <fx:Script>
                          <![CDATA[
                                    import mx.printing.FlexPrintJob;
                  
                                    protected function omg():void
                                    {
                                              try
                                              {
                                                   var printJob:FlexPrintJob = new FlexPrintJob;
                                                   if(printJob.start())
                                                   {
                                                        printJob.addObject(this);
                                                        printJob.send();
                                                   }
                                              } catch(error:Error) { trace('#', error) } // Noooooooooooo!
                                    }
                  
                          ]]>
                </fx:Script>
                </s:Application>
                
                

                 

                # Error: Error #2055: The print job could not be started.
                

                 

                Adobe bug hunters please fix that.

                • 5. Re: Print error
                  Flex harUI Adobe Employee

                  From the doc: AIR profile support: This feature is supported on all desktop operating systems, but it is not supported on mobile devices or AIR for TV devices. You can test for support at run time using the PrintJob.isSupported property. See AIR Profile Support for more information regarding API support across multiple profiles.

                  • 6. Re: Print error
                    devInterama Level 1

                    So there is no support for print

                    • 7. Re: Print error
                      Flex harUI Adobe Employee

                      Not through flash.printing.*;

                       

                      I don’t know how native printing works, but you might be able to create an ANE to do what you need.