A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Printing going wrong

  1. #1
    Member
    Join Date
    Oct 2010
    Posts
    55

    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.COMPLETEimageLoaded);


    function 
    imageLoaded(e:Event){
        
    printmc.addChild(imageLoader);
        
    imprime = new PrintJob();
        
    options = new PrintJobOptions();
        
    options.printAsBitmap true;
        if(
    imprime.start()){
            try {
                
    imprime.addPage(printmcnulloptions);
                
    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!




    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!!

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    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.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center