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

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

Introduction

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

Prototype

public float getX(int units) 

Source Link

Document

Get the x location of the origin 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  ava2  s  . c o  m
    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;
}