O'Reilly logo

ActionScript 3.0 Bible by Roger Braunstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 19. Printing

FEATURED CLASSES

  • flash.printing.PrintJob

  • flash.printing.*

In this chapter, you learn how to print Flash content using the PrintJob class. You'll control what and how to print and even print documents differently than they appear on-screen. You'll also look at different approaches to printing.

Why Print from Flash?

ActionScript is used in many different contexts. For some of the more "traditional" applications, like a Flash banner, printing is out of the question. But with ActionScript being deployed in enterprise-level Flex applications and on the desktop in AIR applications, plenty of situations demand the ability to print, like a timesheet application or ticketing software for an airline.

Additionally, when you're talking about browser-based applications, browsers might not print the contents of a plug-in like Flash Player, so you may have no choice but to develop your own printing scheme.

Even better, when you use the print facilities in ActionScript, you have a lot of control over how things print. You can print multipage documents and control where they break pages; you can be aware of the printer's properties and use the correct page size, orientation, and margins; and you can create your own headers and footers. Of course, printing from Flash Player gives you the advantage of its display capabilities, such as precise layout, high-quality and low-file-size vector graphics, embedded custom fonts, and image processing using filters and BitmapData, to name a few. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required