print issues.
Hojsa...Jeg har et stort problem med mine print funktion...
Den kan godt printe det hele ud stående, men liggende mangler den 1/4 del.
I kan se det på denne link nedenuder: Menu-->lagerstatus-->tryk på 1 fx-->og så gir resten sig selv.
http://www.123ogabc.dk/Advanced.swf
Koden er her:
print_btn.onRelease = function()
{
base.printPages(tableHolder.myTable,1);
};
function printPages(target_mc, frame)
{
if(typeof target_mc == "movieclip")
{
target_mc = [target_mc];
}
trace("printpages: "+target_mc);
// create PrintJob object
var my_pj:PrintJob = new PrintJob();
// display print dialog box, but only initiate the print job
// if start returns successfully.
if (my_pj.start())
{
//
var pageParams = [];
var pj_w = my_pj.pageWidth*0.95;
var pj_h = my_pj.pageHeight*0.95;
//
for (i=0; i<target_mc.length; i++)
{
//
target_mc[i]._width = pj_w;
target_mc[i]._height = pj_h;
//
target_mc[i]._xscale = (target_mc[i]._yscale<target_mc[i]._xscale) ? target_mc[i]._yscale : target_mc[i]._xscale;
target_mc[i]._yscale = (target_mc[i]._yscale>target_mc[i]._xscale) ? target_mc[i]._xscale : target_mc[i]._yscale;
//
var bufferX = -(my_pj.pageWidth-target_mc[i]._width)/2;
var bufferY = -(my_pj.pageHeight-target_mc[i]._height)/2;
//
pageParams[i] = new Object();
pageParams[i] = {xMin:bufferX, xMax:pj_w, yMin:bufferY, yMax:pj_h};
}
//
// use a variable to track successful calls to addPage
var pagesToPrint:Number = 0;
// add specified area to print job
// repeat once for each page to be printed
for (i=0; i<target_mc.length; i++)
{
//
//
var lastframe = target_mc[i]._currentframe;
target_mc[i].gotoAndStop(frame);
if (my_pj.addPage(target_mc[i]._parent, pageParams[i], {printAsBitmap:true}, target_mc[i]._parent._currentframe))
{
pagesToPrint++;
}
target_mc[i].gotoAndStop(lastframe);
target_mc[i]._xscale = target_mc[i]._yscale=100;
}
// send pages from the spooler to the printer, but only if one or more
// calls to addPage() was successful. You should always check for successful
// calls to start() and addPage() before calling send().
if (pagesToPrint>0)
{
my_pj.send();
// print page(s)
}
delete my_pj;
}
//
}
//-------------
