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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.