This content has been marked as final.
Show 4 replies
-
1. Re: printing in more than 1 page a dynamic field.
Devdoc Apr 30, 2007 3:25 AM (in response to bso_71)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 Apr 30, 2007 8:06 PM (in response to Devdoc)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 Dec 4, 2007 1:54 PM (in response to Devdoc)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 Dec 4, 2007 1:54 PM (in response to Devdoc)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?