Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8518695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:03:13+00:00 2026-06-11T06:03:13+00:00

Quick Summary We have a Flash application (AS3) that gives users the ability to

  • 0

Quick Summary
We have a Flash application (AS3) that gives users the ability to read, interact and print content embedded within it. We’ve recently noticed that when printing from Chrome, content is omitted and empty pages are printed (note, blank pages appear in Chrome’s print preview as well). We’re seeing this issue with Chrome’s version “21.0.1180.83” (using Flash Version “11.3.31.230“). This is not reproducible in any other browser.

Technical Details
Each page of content is represented as a Sprite. In order to render content properly, we do some scaling/resizing. We accomplish this with Bitmaps. We create a new BitmapData object (bMapData) and draw the page’s sprite. We take (bMapData) and create a new Bitmap object (bMap) with it. Lastly, we create a new Sprite object (sObj) and add (bMap) as its child. Printing (sObj) renders blank pages.

I’ve included some sample code that can be used to reproduce this:

    private function printAsBitmap(sprite:Sprite):void{
        var bitmapData:BitmapData = new BitmapData(sprite.width, sprite.height, false, 0xffffff);
        bitmapData.draw(sprite);

        var bitmap:Bitmap = new Bitmap(bitmapData);

        var newSprite:Sprite = new Sprite();
        newSprite.addChild(bitmap);

        printSprite(newSprite);
    }

    private function printSprite(clip:Sprite) {

        var printJob:PrintJob = new PrintJob();
        var jobOptions:PrintJobOptions = new PrintJobOptions();     
        jobOptions.printAsBitmap=false;
        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);
                printJob.addPage(clip,null,jobOptions);
                printArea.y += printArea.height;
            }

            /* Send print job to printer */
            printJob.send();

            /* Delete job from memory */
            printJob = null;

        }

    }

Does anyone have suggestions on a “workaround”?

Any and all help is appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:03:15+00:00Added an answer on June 11, 2026 at 6:03 am

    thanks for the file,

    I’ve grabbed it and it is like I’ve said – print content MUST be on stage – following is modified print method of yours:

    private function print(clip:Sprite) {
            if (!clip) return;//safety
    
            var printJob:PrintJob = new PrintJob();
            var jobOptions:PrintJobOptions = new PrintJobOptions();     
            jobOptions.printAsBitmap=false;
            var numPages:int = 0;
            var printArea:Rectangle;
            var printHeight:Number;
            var printY:int = 0;
    
            if (stage)
                stage.addChild(clip);//add to stage for print
    
    
            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);
                    printJob.addPage(clip,null,jobOptions);
                    printArea.y += printArea.height;
                }
    
                /* Send print job to printer */
                printJob.send();
    
                /* Delete job from memory */
                printJob = null;
    
            }
    
    
            if (stage && stage.contains(clip))
                stage.removeChild(clip);//once done remove from stage
    
        }
    

    when I’ve modified it I was able to have printout on google,

    best regards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick summary: I have a Rails app that is a personal checklist / to-do
Quick summary with what I now know I've got an EventWaitHandle that I created
We have the following structure in our Subversion repo: Here is a quick summary:
Quick question: If I have a very large function/sub in a class that is
I have two classes and an interface shown below. Quick summary: Interface Winterface, Class
You may have noticed that we now show an edit summary on Community Wiki
Quick summary of my problem: first rendering of the view contains the elements in
Quick question, I have the following string which is a coma separated list of
Quick method description: I have two tables, lets name them table ONE and table
Quick question (and sorry if it's already been asked, I have looked but couldn't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.