all groups > flash actionscript > april 2007 >
You're in the

flash actionscript

group:

printing in more than 1 page a dynamic field.


printing in more than 1 page a dynamic field. bso_71
4/29/2007 11:23:10 PM
flash actionscript: 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.
Re: printing in more than 1 page a dynamic field. Devdoc
4/30/2007 12:00:00 AM
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!



Re: printing in more than 1 page a dynamic field. bso_71
5/1/2007 3:06:48 AM
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.
AddThis Social Bookmark Button