[swfmill] Trying to print
Joseph Donth
jdonth at donth.com
Sun Mar 4 12:51:44 EST 2007
Hello,
I am trying to print a page via ActionScript and can not get it to work properly. I think it is a timing issue because some pages print correctly but others are missing "pieces" of text. I am attaching the routine I am using. If someone would be willing to take a look at it I'd appreciate it.
The SWF is embedded in the application as "imageInLibrary2" but I have posted the "problem" swf page
on my web site at http://www.donth.com/0002.swf
Note: I am using the SWFMILL and MTASC tools.
Thanks,
Joe Donth
The code I am using follows:
function DoPrint(id, field){ // id = "xxxxx" and field = 2
var job:PrintJob = new PrintJob();
var OK = job.start();
if(OK){
var clip:MovieClip = createEmptyMovieClip("clip",getNextHighestDepth());
clip.attachMovie("imageInLibrary"+field,"image",clip.getNextHighestDepth());
var Format:TextFormat = new TextFormat();
Format.font = "Verdana"
Format.size = 8;
Format.align = "center";
var watermark:TextField = clip.createTextField("watermark",clip.getNextHighestDepth(),0,0, job.pageHeight,12);
clip.watermark.embedFonts = true;
clip.watermark.text = id;
clip.watermark.setTextFormat(Format);
clip.watermark._rotation = 90;
clip.border = true;
clip._xscale = Math.floor((job.pageWidth / job.paperWidth) * 100);
clip._yscale = Math.floor((job.pageHeight / job.paperHeight) * 100);
job.addPage(clip,{xMin:0,xMax:job.pageWidth,yMin:0,xMax:job.pageHeight});
job.send();
}
delete job;
if(OK){return "YES "} else {return "NO"}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/swfmill_osflash.org/attachments/20070304/9adf8eb2/attachment.htm
More information about the swfmill
mailing list