1 Reply Latest reply on Jan 2, 2007 8:44 AM by Devendran

    PrintJob

    olally
      Hi All,

      Im trying to print string using action script.

      When the text is too long it is not taking the next page it is printing in the 1st page and cutting off the rest

      and Im not able to set the left,right,top,bottom margins.

      can any one help me to resolve this problem please

      code:

      (please add more text to msg while testing)

      var msg:String = "fertilizer use resulting in ↑ P adsorbed to soil particles<"+" ** Bennett EM;"+
      "co NF;Correll DL; et al. (1998) Nonpoint pollution of surface waters with phosphorus and nitrogen."+
      "P adsorbed to soil particles</b>"+" ** Bennett EM;Carpenter SR;Caraco NF. (2001) Human impact on "


      //print code

      doPrint(msg);
      function doPrint(msg) {
      trace(msg);
      _root.createTextField(instanceName="print_txt", 1, 10, 10, 400, 100);
      _root.print_txt._x = 100;
      _root.print_txt._y = 100;
      _root.print_txt.autoSize = true;
      _root.print_txt.wordWrap = true;
      _root.print_txt._visible = true;
      _root.print_txt.text = msg;
      var pjTest:PrintJob = new PrintJob();
      if (pjTest.start()) {
      pjTest.addPage(_root.print_txt, {}, true);
      trace("height is :"+pjTest.pageHeight);
      }
      pjTest.send();
      delete pjTest;
      }


      Thanks much in advance

      Lally,
        • 1. Re: PrintJob
          Devendran Level 1
          Hi,
          compare your Content size with PrintSize if size exceed then Split your Content into Multiple page and add it to PrintJob using AddPage.
          See addpage and printjob help for more details