1 Reply Latest reply on May 28, 2006 5:52 PM by Craig Grummitt

    Scrollpane multipage Print.. help Please !!

    Stealla
      Hi All,

      Spent so much time and I really dont find the way to slove this issue so I am pasting my code as below. The "printWishList" Movieclip duplicates itself denpending on the records added by the user in the wishlist. The dilemma is that I want to PRINT that out and the number of pages could be many i.e. depending upon the duplication of the movieclip "printWishList". I need multipage print solution. I am able to get the first page print but the second page is not printing

      quote:



      ///// Using Scollpane for the mc in fla library called "PRINT_AREA"

      function printFormShow()
      {
      var x:Number = 20;
      var y:Number = 391;
      var index:Number = 1;
      print_sp.contentPath = "Print_Area";
      path = print_sp.content;
      path.no_txt.text = "BG 00" + Math.round(Math.random() * 10000);
      trace("Print " + wishMenuArr);

      ///// The MC printWishList contains the dynamic text fields. Data comes
      //// in it from the arrays
      //// printWishList also duplicates according to the arrays. i.e if there
      //// is two set of reconds in the data. It will be duplicated two times


      for (var p = 0; p < capWishArr.length; p++)
      {
      path.attachMovie("printWishList", "printWishList" + index, 3000 + index);
      if (wishMenuArr[catWishArr[p]] != wishMenuArr[catWishArr[(p - 1)]])
      {
      path["printWishList" + index].cat_txt.text = wishMenuArr[catWishArr[p]];
      }
      path["printWishList" + index].venue_txt.text = capWishArr[p];
      path["printWishList" + index].address_txt.text = capWishAddrs[p];
      path["printWishList" + index].city_txt.text = cityWishArr[p];
      path["printWishList" + index]._x = x;
      path["printWishList" + index]._y = y;
      index++;
      y = y + 150;
      }
      }


      /// Calling the function to execute

      printFormShow();


      print_btn.onRelease = multPrint;

      //// MultiPage Print Function

      function multPrint()
      {
      var tp = print_sp.content;
      tp.setMask(null);
      var pj : PrintJob = new PrintJob();
      var ptp = 0;
      if (pj.start())
      {
      if (pj.addPage(tp, {xMin:0, xMax:600, yMin:0, yMax:800}))
      {
      ptp++;
      }
      if (ptp>0)
      {
      pj.send();
      }
      delete pj;
      }
      tp.setMask(print_sp.mask_mc);
      abcd.removeMovieClip();
      }




      Am I doing something wrong with the multPrint function. Any sugguestion or help please.

      Thanks in Advance
        • 1. Re: Scrollpane multipage Print.. help Please !!
          Craig Grummitt Level 3
          your code only seems to be requesting one page to print...? you have to call 'addPage' for each page you wish to add.

          in this case, this would be achieved most conveniently in a for statement. something like below (add this code after your currently existing addpage statement, and before the if (ptp>0) statement).

          by the way, it looks like you've also got two counter variables that are doing pretty much the same thing(except index=p+1).

          anyway, hope this sloves your issue

          Craig