Groups | Blog | Home
all groups > flash actionscript > march 2006 >

flash actionscript : Print full scrollpane content


OniLink
3/12/2006 11:54:40 PM
Hi,

I've tried using the print() function to print a scrollpanes content, but all
it prints is that which is visible. Is it possible to print all of the content,
including that which is not visible in the pane at that particular moment.

Thanks for any help,
~Oni.
boyBacon
3/13/2006 11:12:49 AM
You should really search the forum before posting your problem -- more often
than not you will find a solution.

http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=288&thre
adid=1118524&highlight_key=y&keyword1=printjob - this thread is a good starting
point for printing text from a textarea, although it's still not a perfect
solution.
Devendran
3/13/2006 1:09:40 PM
What s Scroll pane: its combination of movie Clips. It uses Setmask to hide
exceeding Data portion.. so using setmask(null u can be able to view whole
content. now give this content to Print. and reset the mask
After analysing the Scrollpane here s a code.



scrl_pane.content.setMask(null);//This will show all the content
printObj.addPage("scrl_pane.spContentHolder", {xMin:startX, xMax:endX,
yMin:startY, yMax:endY});//Add printable area
printObj.send();//Send this content to print
scrl_pane.content.setMask(scrl_pane.mask_mc);//reset teh mask to hide
exceeding data
OniLink
3/13/2006 1:29:22 PM
Thanks heaps for your help.

On the last line you have:
scrl_pane.content.setMask(scrl_pane.mask_mc);

Devendran
3/13/2006 2:07:15 PM
yes
OniLink
3/16/2006 12:00:00 AM
Nothing happens when the button is pressed. This is the exact code I'm using:

on (release) {
pane.content.setMask(null); //This will show all the content
printObj.addPage("pane.spContentHolder");//Add printable area
printObj.send(); //Send this content to print
pane.content.setMask(pane.mask_mc);//reset the mask to hide exceeding data
}
Devendran
3/18/2006 12:00:00 AM
Hi,
Its better to add your page and sending it after the printing started.

here i am attaching one simple implementation of printJob

http://www.geocities.com/devendran_be/print_example.fla

i have used the follwing code
(u can refer this on the source also);

remove_btn.onRelease = function(){
myPane.content.setMask(null);
}
set_btn.onRelease = function(){
myPane.content.setMask(myPane.mask_mc);
}
print_btn.onRelease = function(){
var printObj_pj:PrintJob = new PrintJob();
if (printObj_pj.start()) {
myPane.content.setMask(null);
//
printObj_pj.addPage("_root.myPane.spContentHolder", {xMin:0, xMax:0,
yMin:300, yMax:300});
printObj_pj.send();
//
myPane.content.setMask(myPane.mask_mc);
}
}
OniLink
3/19/2006 3:00:05 AM
AddThis Social Bookmark Button