Hi Every1.
Im trying to print a certificate in a4 landscape format and i managed to do that fine, however the problem im getting is that when it prints it does not adjust the margins, which in the end, it ends up with a tiny left margin and a massive right one, even though the movieclip that is being printed is in the correct size etc.
How can I center the movieclip on the print out?
Here is my code:
import flash.printing.PrintJob;
import flash.display.Sprite;
import flash.text.TextField;
import flash.display.Stage;
import flash.geom.Rectangle;
function PrintScaleExample() {
printPage();
}
function printPage():void {
var pj:PrintJob = new PrintJob();
if (pj.start()) {
var margin_height = (pj.paperHeight - pj.pageHeight) / 2;
var margin_width = (pj.paperWidth - pj.pageWidth) / 2;
try {
certMC.x = margin_width;
certMC.y = margin_height;
certMC.width = 11.11 * 72;
certMC.height = 8.33 * 72;
certMC.rotation = 90;
pj.addPage(certMC);
} catch (error:Error) {
// Do nothing.
}
pj.send();
} else {
}
}
Thanks for your help guys! Really cant find anything or do anything about this, have wasted about a thousand trees due to this issue ¬¬ lol
:upset: