Example usage for java.awt GraphicsDevice TYPE_PRINTER

List of usage examples for java.awt GraphicsDevice TYPE_PRINTER

Introduction

In this page you can find the example usage for java.awt GraphicsDevice TYPE_PRINTER.

Prototype

int TYPE_PRINTER

To view the source code for java.awt GraphicsDevice TYPE_PRINTER.

Click Source Link

Document

Device is a printer.

Usage

From source file:org.apache.pdfbox.rendering.PageDrawer.java

@Override
public void showAnnotation(PDAnnotation annotation) throws IOException {
    lastClip = null;/*from w w w. ja  v  a  2 s.c o  m*/
    //TODO support more annotation flags (Invisible, NoZoom, NoRotate)
    int deviceType = graphics.getDeviceConfiguration().getDevice().getType();
    if (deviceType == GraphicsDevice.TYPE_PRINTER && !annotation.isPrinted()) {
        return;
    }
    if (deviceType == GraphicsDevice.TYPE_RASTER_SCREEN && annotation.isNoView()) {
        return;
    }
    if (annotation.isHidden()) {
        return;
    }
    super.showAnnotation(annotation);
}