Help printing textarea

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.

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.

Similar Messages

  • Help for printing textarea

    hi
    How can I print a long line.
    for exmple
    0123456789012345678901234567890123456789012345678901234567890123456789
    if i print a textarea with this content i get a printout that looks like this:
    012345678901234567890123456
    do i have to set anything so that the line is wrapped??
    my code looks like this:
    1st part:
    public class Ta extends JTextArea implements Printable{
         public Ta(){
              super();
              this.setPreferredSize(new Dimension(500,500));
         public Ta(int x, int y){
              super(x,y);
         public int print(Graphics g, PageFormat pf,int pi){
              if (pi >= 1) {
                   return Printable.NO_SUCH_PAGE;
              Graphics2D g2 = (Graphics2D) g;
              g2.translate(pf.getImageableX(),pf.getImageableY());
              Font f = new Font("Monospaced", Font.PLAIN,6);
              g2.setFont (f);
              g2.drawString(this.getText(),100,100);
              this.paint(g2);
              return Printable.PAGE_EXISTS;
    2nd:
              b.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        if(pj.printDialog()){
                             PageFormat pformat = pj.defaultPage();
                             pformat.setOrientation(PageFormat.PORTRAIT);
                             System.out.println(pj.defaultPage());
                             pj.setPrintable(ta,pj.pageDialog(pformat));
                             try{
                                  pj.print();
                             catch(PrinterException p){

    You got me wrong!My deepest regrets! :-)
    Wait, somewhere I had seen some example of just this.
    Ok... "found" it.
    (As you shall see, the code is actually decompiled -by some demo application not commercial, mind you- so to find this useful you need to try to understand what all this variables are used for)
    class NotepadPrinter implements Printable {
      public int print(Graphics g, PageFormat pageformat, int i) {
        Graphics2D graphics2d = (Graphics2D)g;
        try {
          return paintText(graphics2d, pageformat, i);
        } catch(Exception exception) {
          exception.printStackTrace();
        return 1;
      int paintText(Graphics2D graphics2d, PageFormat pageformat, int i) throws Exception {
        int j = (int)pageformat.getImageableHeight();
        int k = (int)pageformat.getHeight();
        graphics2d.translate(pageformat.getImageableX(), pageformat.getImageableY());
        graphics2d.setFont(getEditor().getGraphics().getFont());
        graphics2d.setColor(Color.black);
        String s = null;
        try {
          s = getEditor().getText(0, getEditor().getDocument().getLength());
        } catch(BadLocationException badlocationexception) {
          throw new Exception(badlocationexception.getMessage());
        java.awt.font.FontRenderContext fontrendercontext = graphics2d.getFontRenderContext();
        java.awt.geom.Rectangle2D rectangle2d = graphics2d.getFont().getMaxCharBounds(fontrendercontext);
        double d = rectangle2d.getWidth();
        double d1 = rectangle2d.getHeight() + 2D;
        double d2 = pageformat.getImageableWidth();
        int l = (int)(d2 / d);
        String as[] = getLines(s);
        int i1 = as.length;
        double d3 = d1 * (double)i1;
        int j1 = (int)((double)j / d1);
        int k1 = i1 / j1 + 1;
        int l1 = j1 * i;
        int i2 = getNumLinesForPage(as, i, j1);
        int j2 = (l1 + i2) - 1;
        if(l1 >= as.length)
          return 1;
        String as1[] = new String[i2];
        System.arraycopy(as, l1, as1, 0, i2);
        float f = 10F;
        LineMetrics linemetrics = graphics2d.getFont().getLineMetrics("A", fontrendercontext);
        double d4 = (double)linemetrics.getHeight() + 2D;
        for(int k2 = 0; k2 < as1.length; k2++) {
          graphics2d.drawString(as1[k2], 10F, f);
          f = (float)((double)f + d4);
        return 0;
      String[] getLines(String s) {
        StringTokenizer stringtokenizer = new StringTokenizer(s, "\n");
        Vector vector = new Vector();
        while(stringtokenizer.hasMoreTokens())
          vector.add(stringtokenizer.nextToken()));
        return (String[])vector.toArray(new String[0]);
      int getNumLinesForPage(String as[], int i, int j) {
        if(as.length < (i + 1) * j) {
          int k = as.length - i * j;
          return k;
        } else {
          return j;
    }

  • Need helping printing to networked printers.

    I need help setting up network printers that have a code on them for each individual. There is no place to put a code so the printer will know who is printing what. I have installed 3 printers and they will not print, they just go to a paused mode and when you hit resume in reverts back to pause because it is looking for a code. I have tried it another way but it asks for a user name and password and all we have are codes. The workplace is using a windows based server and the copiers are listed as followed.
    Konica biz hub c450
    Sharp ar m700n
    sharp mx700n
    I need help to be able to print from my mac. I also have parallels running with xp installed and all the printers are installed on that side and printing fine. Hopefully someone can help me out.
    Thanks in advance

    Hello and welcome to Apple Discussions.
    In order to provide the user with the ability to input a user code, the respective printer driver would have to provide the facility. If this feature did exist on a previous version of OS X, then you may have to check the vendors web site to see if there is a driver for 10.6.
    If you are not sure if the function was supported previously, then go through all the user menus for the driver. The function may be present but located in an unusual location. Or it could require an additional file (aka plugin) that could be missing from the driver installation or not compatible with 10.6.
    The other thing to note is that if you have the Mac's printing via a Windows queue, you will have to provide user credentials for SMB print queues. This is typically a Windows user account - not the Mac's account details. If you don't want to create accounts for the Mac users on the Windows server, then you can use LPD rather than SMB to connect to the Windows queues. This does require UNIX Printing Services to be enabled on the server.
    Pahu

  • I need help printing with HP laserjet 2200 and OS 10.6

    I need help setting up my HP laserjet 2200 and OS 10.6 -- I've downloaded and installed all the software and still can't print.

    Hey jeo1951,
    If you haven't already, try running through the recommended steps in the following article:
    Mac 101: Printing (Mac OS X v10.6)
    http://support.apple.com/kb/HT3771
    It should help you set up your printer.
    Welcome to Apple Support Communities!
    All the best,
    Delgadoh

  • HELP- Printing Problem with Photoshop CS4

    Hello Everyone,
    I just bought the PHOTOSHOP CS4, and I am having problem when it prints. The image is not clear, it has dots (pixels). This computer where I installed this program is brand new. I have previously worked with Photoshop CS2 and never had an issue but was force to buy this new one because the computer that I bought has Windows Vista and CS2 is not compatible. I thought maybe the problem was my printer but is not I have a Brother HL-5140 (black and white). I have connected my old computer with the printer and the images print perfectly fine. I have printed photos and it prints clear. But this only happens with Photoshop CS4. It prints dots, can someone please help me. Is driving me crazy.

    Really I'd be willing to bet it's your driver under Vista.
    I have the same problem using Vista and a older HP LaserJet, under XP and CS2 it prints well. Under Vista it's a bunch of dithered pixelated dots.
    They want you to buy a newer printer.

  • HELP printer compatability with computor.

    Help...Have hp psc 1310  hp officejet 4200 series......Got a new gateway which is Vista and my old one was XP......my printer will print, but can not scan and tried to program the cd in again and computor would not accept it.  Will I need to get a new printer that is compatable with Vista?   Any thing to update of just have to get new?
    thanks enhelder
    Message Edited by enhelder on 07-07-2009 10:51 AM

    Hello Highcountryhike,
              Thank you for posting your request.  You should have no issues updating to 10.10 Yosemite.  Below are a couple links that should help.
    If you run the Software Updates from the Apple Menu, to check for updates.  Some have had issues not seeing updates, so simply click on "Store" from the top menu, and then click on Reload Page".  Select to install HP Updates to ensure you have the latest drivers.
    In some instances, the printer can be updated in the printer queue to resolve other issues, so check to make sure that the printer is listed with the HP Printer Series driver and not just AirPrint.  System Prefernces/Printers & Scanners/ select your printer on the left and check on the right side under "Location:" that Kind: is the printer series.  You can also click the "-" symbol to remove and then re-add the printer queue again, choosing the HP Printer series name to install the drivers.
    Installing the Full Feature HP Printer Driver in OS X v10.10 Yosemite
    Mac OS 10.10 Yosemite and HP Printer Support
    Please post back with any further issues/questions.
    Thanks,
    Double-U-Dee
    Don't forget to give Kudos where Kudos is Due - OR - if a Response Resolved your Issue, Click the "Accept as Solution"
    I am an HP employee, but my posts and replies are my own and do not reflect the opinion of HP.

  • Help printing raw profiling target!!

    I know this has been beaten around, but I am looking for help, and the latest information on printing a raw target for printer profiling. I'm having troubles getting a decent target to profile.
    First PSCS4, OSX 10.6.8 (Snow Leopard), Mac Pro Tower, Epson 1400 inkjet printer with Epson Claria inks. Driver is the Epson SP 1400 Series driver. Nozzle check and print head alignment are fine.
    I printed out an untagged RGB test strip file four times on the same sheet of glossy paper. This file has 21 steps of gray, four each of red, green and blue, and three each of cyan, magenta and yellow. I use this file to help me pick the best driver settings when creating RGB printer profiles.In each case, the Epson driver used the exact same settings, with Color Management set to No Color Adjustment. Here are the PS dialog settings I used in each test print:
    1. Untagged file, No Color Management in print dialog box
    2. Untagged file, Printer Manages Color, RelCol, no BPC (according to Eric Chan, rendering intent is ignored in this mode)
    3. File tagged with ARGB, Photoshop Manages Colors, profile set to ARGB destination profile, RelCol, BPC turned off.
    4. File tagged with sRGB, Photoshop Manages Colors, profile set to sRGB destination profile, RelCol, BPC turned off.
    I've been wary of Photoshop's "No Color Management" for awhile in Snow Leopard due to reported OS override, etc, but I wanted to compare the above four methods. Items 3 & 4 above were reported as workarounds on the Luminous Landscape site.
    I found that methods 1 and 2 (NCM and Printer Manages) were very close to each other, within spectro error and usually less than 0.5 Delta E. Item 3 (ARGB to ARGB) should be identical, since it is a null conversion, but it is very different from 1 and 2. Item 4 (sRGB to sRGB) was different from the ARGB to ARGB conversion and also different from 1 & 2 by the widest margin. Holy smokes, folks! So, at least with the PSCS4, OSX 10.6.8 and the Epson 1400, the Luminous Landscape workaround does NOT work. While 1 and 2 seem to be a pretty good match, I have no idea whether they are both accurate RAW output, or whether they are both the same and both similarly flawed.
    I just want to build a damn profile. I've been studying and using color management for 15 years, so I am not exactly new to this stuff.
    HELP!!!
    Thanks,
    Lou Dina

    Thanks, Dave.
    That worked. I just created a glossy profile and got a great print from my new profile.
    Best, Lou

  • Need help - Print Menue in Acrobat Pro and Standard

    Hello,
    at first, i have to apologize for my bad englisch because I'm german.
    I downloaded a Trial of Acrobat pro and there I hava an extended Print menue where I can choose individual Color Profiles.
    There is an image attached.
    But I don't really need the Acobat pro Features, because I need Acrobat only for Color Printing on my Printer. And it ist expensive.
    So my Question to you is: Is this extended Print menue also in Acobat 9 Standard?
    There is no Trial, so that I hope, that someone can help me.
    Can I also set this settings in Acrobat 9 Standard?
    Thank you very much for helping me with my buying decision.
    Greetings from Munich
    Sebastian

    The Advanced Print menu in 9 Standard does not have all of the options that are in your screen shot.
    Checked with a coworker who has 9 Standard, and the options are much more limited. (I have 8 Pro).
    Bad news is you would need 9 Pro.
    Saw this the other day; sorry for the slow answer, good luck.

  • Need help printing in Classic to HP 1510

    I'm helping a person with an early 2001 iMac (500 MHz, 384 MB RAM) who's running 10.2.8 and 9.2.2. She got an HP 1510 all-in-one printer/scanner, and I'm trying to get it set up. I installed the printer software for OS X and for 9.2.2 (while running under 9.2.2) I can print from a 9.2.2 application (like Word for Office 2001) while running under 9.2.2, and I can print from an OS X application, but I can't print from a Classic application under OS X!
    When she tries to print from Office 2001 under Classic, the HP 1510 printer is found under "Page Setup" and "Print" in the Office 2001 application, the print job spools, but the Print Manager under Classic claims no printer is installed, and the Chooser under Classic can't find a USB-based printer under "HP Inkjet v6.6.1". This is where I found the USB-based printer when she was running 9.2.2. She has tried running the Desktop Printer Setup utility under Classic, but it doesn't see the USB-based HP 1510.
    What do I need to do to enable printing under Classic?

    gave up.

  • HELP - Print to Video

    I so frustrated. I'm trying to print to Video to Archive my old footage. Final Cut reconizes my camera that I'm Printing to but when I go to print all I get is blue screen. I Printed to Video before and it worked fine. I'm connecting with Firewire. It's on the VCR setting. Am I missing something.
    Please help
    PowerMac G5   Mac OS X (10.4.2)  

    As I recall, Canon's need some funny business with record-pause in VCR mode. I used to have to do this sequence with my GL2 and I think that while the XL2 is a far better instrument, the software for this is probably related. I always had to use the remote to make it work easily with the GL2. Search your manual for instructions around this record pause thing and I think you may find the solution.

  • PDF help. printing PDFs make acrobat or reader go not responding.

    Whenever i try to print or go to print setup in either Acrobat or Reader it cause the program to not respond and i will have to exit the program and it will not print. But if i right-click a .pdf file (like saved on my desktop) and click print it will print just fine.... I am using Acrobat 8.2.6....i think. Any help would be greatly appreciated, thanks.

    As Michael said, it is probably a conflict between the two. You may be able to uninstall Reader (assume you have Reader 9) and repair Acrobat. Uninstalling one will usually break the other and the repair should fix it.

  • HELP - Print PDF to iPhoto Workflow Failure

    Hi folks - I am trying to export to iPhoto from Pages by following these steps...
    File > Print > PDF > Save PDF to iPhoto
    iPhoto then launches and I'm asked to select an album. No matter what option I select at this point, once I hit "Continue" I receive a "Workflow Failed" error in the upper right of my screen.
    Anyone have a fix or work-around for getting Pages documents into iPhoto?
    Thanks!
    Tom

    Hello Tom,
    welcome to the Pages Discussions. I can't help you to solve your problem, but for other members, it would be helpful, when you post a few details about your software versions (Pages, iPhoto, Mac OS X) and about your hardware. As more infos you post as quicker the answers can arrive without reposts of questions.
    Frank.

  • Someone Help Print To Go

    Hi All,
    I just can't get connected - when I download PTG software right at end Printers box message 'Operation could not be completed' but then says PTG installed successfully.
    When I go to print a document PTG shows and  after selecting it I go to pairing mode all = ok thena box titled  Print To Go Connecter box says PTG has encountered a problem and needs to close. ?
    Please someone help !I have turned AVG firewall off etc but still can't get it to work !!
    Many thanks
    Doug

    Is your computers using Win7? I use XP PRO and it works fine. A few people using Win7 are having problems.

  • Please help printer wont print a legal document

    please help me printer wont print legal documents??? 

    Hi,
    which printer do you have is it an Officejet, laserjet or a Photosmart?
    I work for HP but my posts and replies are my own.
    Make it easier for other people to find solutions, by marking my answer with \'Accept as Solution\' if it solves your problem.
    Click on the BLUE KUDOS button on the left to say "Thanks"

  • Help printing information

    hi
    i have a class "Club"
    it contains an ArrayList, add and remove methods and a method to retrieve player details. (The code for class Club is provided below).
    i want to write a new class called Main which prints out the information held about each player in the club.
    is this possible and if so how would i go about achieving this?
    Any help would be greatly appreciated.
    Many thanks.
    public class Club
        public String clubname;
        ArrayList<Player> players = new ArrayList<Player>();
        public Club(String clubname)
           this.clubname = clubname;      
        public void addPlayer(String firstname, String surname, int age, double height, int weight, int gamesplayed, int runsscored, int timesdismissed)
            players.add(new Player (firstname, surname, age, height, weight, gamesplayed, runsscored, timesdismissed));
        public void removePlayer(String firstname, String surname, int age, double height, int weight, int gamesplayed, int runsscored, int timesdismissed)
            players.remove(new Player (firstname, surname, age, height, weight, gamesplayed, runsscored, timesdismissed));
        public void addBowler(String firstname, String surname, int age, double height, int weight, int gamesplayed, int runsscored, int timesdismissed, int ballsbowled, int wicketstaken, int runsconceded)
            players.add(new Bowler (firstname, surname, age, height, weight, gamesplayed, runsscored, timesdismissed, ballsbowled, wicketstaken, runsconceded));
        public void removeBowler(String firstname, String surname, int age, double height, int weight, int gamesplayed, int runsscored, int timesdismissed, int ballsbowled, int wicketstaken, int runsconceded)
            players.remove(new Bowler (firstname, surname, age, height, weight, gamesplayed, runsscored, timesdismissed, ballsbowled, wicketstaken, runsconceded));
        public void addWicketKeeper(String firstname, String surname, int age, double height, int weight, int gamesplayed, int runsscored, int timesdismissed, int catches, int stumpings)
            players.add(new WicketKeeper (firstname, surname, age, height, weight, gamesplayed, runsscored, timesdismissed, catches, stumpings));
        public void removeWicketKeeper(String firstname, String surname, int age, double height, int weight, int gamesplayed, int runsscored, int timesdismissed, int catches, int stumpings)
            players.remove(new WicketKeeper (firstname, surname, age, height, weight, gamesplayed, runsscored, timesdismissed, catches, stumpings));
        public Player retrievePlayer(String firstname, String surname)
            Player retPlayer = null;
            for (Player player : players)
                if (player.getFirstname().equals(firstname) ||
                  player.getSurname().equals(surname))
                    retPlayer = player;
            return retPlayer;
        public String getClubname()
            return clubname;
    }

    hi,
    iv written the following code in my main class
    however, i want to write a getDetails method in the player class
    i dont know where to start with this
    i would appreciate any help on the matter
    thanks very much
    public class Main
         public void playerDetails(Club theClub)
              List<Player> playerList = theClub.players;       
              for(Player p : playerList)       
                      System.out.println(p.getDetails());       
    }

Maybe you are looking for

  • Loading consolodated data from two excel files / cube into one infocube

    Hi Friends, I am receiving data from two sources: Source 1: Customer Product  Location                          Keyfig(Budget) C1            P1          L1                                     100 C2            P1         L1                           

  • How to customize the color of EBS webpage

    Hi Hussein, I want to change background color of EBS webpages. Some default customized look and feel webpages are there,but client requires some specific color is not matched with available default webpages. How we can customize the webpages regardin

  • Round badi does not work in default formulas triggered when sending a value

    I have implemented the round BADI from sdn (how to). Problem is that it works perfect when : -  I execute it in UKT - I run it as a data manager package - I put it in default formulas and run the default formulas as a packe It however doesn't work wh

  • IPhone glitchy and worsening?

    I bought the iPhone 4s around the 17th October. I had no issues until a month after where I noticed there was some glitching here and there, but nothing too noticeable. So I ignored. It's now becoming impossible at times to even use it.. Often I can'

  • Since two days I get an error message when I try to sign in without further notice what is the cause

    Since two days I become an error message when I try to sign in without any further information what is the cause of this error message.