CHAPTER 30

image

Understanding the Print API

In this chapter, you will learn:

  • What the Print API is
  • How to obtain the list of available printers
  • How to get the default printer
  • How to print nodes
  • How to show the page setup and print dialog to users
  • How to customize the setting for the printer jobs
  • How to setup the page layout for printing
  • How to print webpages displayed in a WebView

What is the Printing API?

JavaFX 8 added support for printing nodes through the Print API in the javafx.print package. The API consists of the following classes and a number of enums (not listed):

  • Printer
  • PrinterAttributes
  • PrintResolution
  • PrinterJob
  • JobSettings
  • Paper
  • PaperSource ...

Get Learn JavaFX 8: Building User Experience and Interfaces with Java 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.