我有一个很长的可滚动列表,有超过800条记录,我想用一个打印作业打印整个列表,但它只打印可查看的项目只有我的功能:
function printMovieClip(clip:List) {
var printJob:PrintJob = new PrintJob();
var numPages:int = 0;
var printArea:Rectangle;
var printHeight:Number;
var printY:int = 0;
if ( printJob.start() ) {
/* Resize movie clip to fit within page width */
if (clip.width > printJob.pageWidth) {
clip.width = printJob.pageWidth;
clip.scaleY = clip.scaleX;
}
/* Store reference to print area in a new variable! Will save on scaling calculations later... */
printArea = new Rectangle(0, 0, printJob.pageWidth/clip.scaleX, printJob.pageHeight/clip.scaleY);
numPages = Math.ceil(clip.height / printJob.pageHeight);
/* Add pages to print job */
for (var i:int = 0; i < numPages; i++) {
printJob.addPage(clip, printArea);
printArea.y += printArea.height;
}
/* Send print job to printer */
printJob.send();
/* Delete job from memory */
printJob = null;
}
}