Example usage for javax.print.attribute.standard MediaPrintableArea getWidth

List of usage examples for javax.print.attribute.standard MediaPrintableArea getWidth

Introduction

In this page you can find the example usage for javax.print.attribute.standard MediaPrintableArea getWidth.

Prototype

public float getWidth(int units) 

Source Link

Document

Get the width of the printable area in the specified units.

Usage

From source file:org.pentaho.reporting.engine.classic.extensions.modules.java14print.Java14PrintUtil.java

private static Paper createPaper(final MediaSize mediaSize, final MediaPrintableArea printableArea) {
    final Paper paper = new Paper();
    if (mediaSize != null) {
        paper.setSize(mediaSize.getX(Size2DSyntax.INCH) * POINTS_PER_INCH,
                mediaSize.getY(Size2DSyntax.INCH) * POINTS_PER_INCH);
    }//from   w  w  w.  j  a v a 2s.  com
    if (printableArea != null) {
        paper.setImageableArea(printableArea.getX(Size2DSyntax.INCH) * POINTS_PER_INCH,
                printableArea.getY(Size2DSyntax.INCH) * POINTS_PER_INCH,
                printableArea.getWidth(Size2DSyntax.INCH) * POINTS_PER_INCH,
                printableArea.getHeight(Size2DSyntax.INCH) * POINTS_PER_INCH);
    }
    return paper;
}