4 Replies Latest reply on Dec 4, 2007 1:54 PM by FabioIKO

    printing in more than 1 page a dynamic field.

    bso_71
      I want to print a dynamic text field when my user clicks a button. This dynamic text field is more than 1 page long so I don't want it to be scaled. I want it to be printed in more than 1 page. How can I do this!!!!!

      Please if anyone can help me.

      Thanks,

      brenda s.
        • 1. Re: printing in more than 1 page a dynamic field.
          Devdoc Level 1
          Hi!

          There are plenty of tricky ways to do this. Here is an easy one.

          First, create a printjob instance ( var myPrintjob:printjob = new PrintJob(); )
          Initiate myPrintjob.start() to gain access to the properties of the users printer, such as how much will fit on a page.

          Second, check to see if the textfield is to long to fit in a page. This can be done by checking textfield.height and see if it is bigger that myPrintjob.paperHeight. Split the content to more than one movieclip if it is too long to fit on one page.

          Third, use myPrintjob.addPage() to add each movieclip as a single page to your printjob.

          And myPrintjob.send() to print it out!


          • 2. Re: printing in more than 1 page a dynamic field.
            bso_71 Level 1
            I used the next code but nothing happends. What am I doing wrong!!! Is this code correct so I can print several pages?

            var my_pj = new PrintJob();
            if (my_pj.start()) {
            for (var i = 0; i<2; i++) {
            my_pj.addPage(this["page"+i+"_mc"], {xMin:0, xMax:860, yMin:0, yMax:1024});
            }
            my_pj.send();
            delete my_pj;
            }

            I've never used this code and I don't know if I'm doing it correctly.

            Thanks a lot for your help!

            Brenda S.
            • 3. Re: printing in more than 1 page a dynamic field.
              FabioIKO Level 1
              The question is: how split long text in sevearal clips?
              I used bottomscroll, but it fails.
              I create several movieClip and a new textField in each one.
              For each textField I change the bottomscroll and set txt.scroll=txt.bottomscroll+1;

              for(var i:Number=0;i<2;i++)
              {
              var mc:MovieClip=_root.createEmptyMovieClip("mc"+i, i)
              var txt:TextField=mc.createTextField("txt", 1, etc...
              if(i>0){txt.scroll=txt.bottomscroll+1;}
              }

              When I use printJob next pages repeats some lines of previous page.
              But in the screen, everything looks right.
              What is wrong?
              • 4. Re: printing in more than 1 page a dynamic field.
                FabioIKO Level 1
                The question is: how split long text in sevearal clips?
                I used bottomscroll, but it fails.
                I create several movieClip and a new textField in each one.
                For each textField I change the bottomscroll and set txt.scroll=txt.bottomscroll+1;

                for(var i:Number=0;i<2;i++)
                {
                var mc:MovieClip=_root.createEmptyMovieClip("mc"+i, i)
                var txt:TextField=mc.createTextField("txt", 1, etc...
                if(i>0){txt.scroll=txt.bottomscroll+1;}
                }

                When I use printJob next pages repeats some lines of previous page.
                But in the screen, everything looks right.
                What is wrong?