Skip to main content
alant89925235
Participant
June 24, 2015
Question

Print feature in .swf does not work in Chrome.

  • June 24, 2015
  • 2 replies
  • 1877 views

We have several Flash activities which allow users to print from the swf.  For example, if you go to abcya.com/abcya_paint.htm you can create a picture and press print in the swf.  The feature works fine in all browsers except Chrome.  In Chrome the "print" button in the swf leads to Chrome printing the entire HTML page.  Any ideas on why this is happening?

This topic has been closed for replies.

2 replies

jeromiec83223024
Inspiring
June 25, 2015

I believe that you're doing something wrong when invoking print.  We have a fairly extensive printing test suite in Flash, and a lot of large companies use printing for things like shipping labels and ticketing.

While I'm able to reproduce the problem that you've described on your site, I also confirmed that our tests are printing just the stage, which is the outcome you're looking for.

Here are some snippets from one of the tests that might be useful.  In this case, there's one button that prints the stage normally, and another that prints it as a bitmap.  In both instances, just the stage is displayed in Chrome's print preview.


import flash.printing.PrintJob;

import flash.printing.PrintJobOrientation;

import flash.display.Stage;

import flash.display.Sprite;

import flash.display.TextField;

import flash.geom.Rectangle;

import flash.text.*;

var myStage = this;


function myPrint(toley)

{

      var myRect = new Rectangle(0,0,400,325);

      print_txt.text = "Print";

      var pp:PrintJob = new PrintJob();

     if (pp.start())

      {

           pp.addPage(myStage,myRect,null,0);

           pp.send();

      }

      pp = null;

}

print_btn.addEventListener("click",myPrint);

function myBPrint(ken)

{

      print_txt.text = "Bitmap Print";

      var myRect = new Rectangle(0,0,400,325);

      var pp:PrintJob = new PrintJob();

      if (pp.start())

      {

           var options = new PrintJobOptions()

           options.printAsBitmap = true

           pp.addPage(myStage,myRect,options,0);

           pp.send();

      }

      pp = null;

}

bitmap_btn.addEventListener("click",myBPrint);

Participant
April 8, 2016

A school has used my site www.arithmequick.com for years to create and print a Week Calendar for parents. It has always printed 'til now.

Today I received this note from their IT Person:  A printing issue occurs in Chrome with Flash 21.0.0.213, but does not occur in IE with Flash 21.0.0.182.  We've seen it happen on multiple computers with the 213 version. 

Since Flash is bundled with Chrome, there's not a lot I can do to downgrade, but I can probably keep IE at a working version temporarily as a work around.

Please help!

Participating Frequently
April 8, 2016

Hi,

can you share steps to reproduce the issue.

Participating Frequently
June 25, 2015

Hi,

Please share more information about your computer and browser.

Read Before Posting: How To Get A Useful Answer To Your Question

Thanks

Kratika