1 Reply Latest reply on Apr 21, 2010 2:40 PM by jack182

    help printing textarea

    jack182 Level 1

      Hello,

       

      I have problem printing textarea when sending it to print job and here my code:

       

      <mx:TextArea id="mainTextField" styleName="letterTextArea" wordWrap="true" x="46" y="38" width="666" height="389" horizontalScrollPolicy="off"/>

       

      private function printLetter():void
                  {
                      var printJob:PrintJob = new PrintJob();
                      printJob.copies = 1;
                      printJob.orientation = PrintJobOrientation.PORTRAIT;
                     
                      //var rect:Rectangle = new Rectangle(0,0,800,600);
                     
                      printJob.start();
                 
                      try
                      {
                          printJob.addPage(mainTextField);
                          printJob.send();
                      }
                      catch(err:Error)
                      {
                          //Alert.show("Error printing letter: "+err);
                      }
                  }

       

      ...the only printed in the printer is the visible part of textarea. How can I print the entire text? any idea?

       

      thanks a lot.

      cheers.

        • 1. Re: help printing textarea
          jack182 Level 1

          I finally got it to work like this:

           

          var tmpBox:Text = new Text();
                          tmpBox.setStyle("paddingTop",50);
                          tmpBox.setStyle("paddingLeft",50);
                          tmpBox.setStyle("paddingRight",50);
                         
                          addChild(tmpBox);
                          tmpBox.width = printJob.pageWidth;
                          tmpBox.height = printJob.pageHeight;
                          tmpBox.text = mainTextField.text;

           

          the problem is there is always a blue/light blue backgrounnd. how can remove that background? i already use css but no luck at all...any idea on how to do this?

           

          thanks a lot.

          cheers.