-
Printing going wrong
Hey guys.
Im havin some trouble printin' on as3. What I have is the following code:
PHP Code:
var req:URLRequest = new URLRequest("http://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Flag_of_Chiyoda,_Tokyo.svg/800px-Flag_of_Chiyoda,_Tokyo.svg.png")
var imageLoader:Loader = new Loader();
imageLoader.load(req);
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
function imageLoaded(e:Event){
printmc.addChild(imageLoader);
imprime = new PrintJob();
options = new PrintJobOptions();
options.printAsBitmap = true;
if(imprime.start()){
try {
imprime.addPage(printmc, null, options);
imprime.send();
} catch (e:Error){
//do nothing
}
}
}
Basically, what it does is load an external image, adds it to a movieclip on stage (printmc), and then it prints. So far, so good.
But the problem is when it shows me the print, it's on the wrong position!
http://i51.tinypic.com/21e2pls.png
as you can see from the wikipedia link, it was supposed to print a much larger picture.
That dark spot at the upper left has the same color as the background, so im afraid it is messing at some way with it.
Any help is greatly appreciated. Thanks in advance!!
-
1 Attachment(s)
Your code worked for me perfectly.. Only issue I had was that the image was wider than my printed page so it was cut off on the right.