Example usage for com.itextpdf.text.pdf PdfWriter PrintScalingNone

List of usage examples for com.itextpdf.text.pdf PdfWriter PrintScalingNone

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfWriter PrintScalingNone.

Prototype

int PrintScalingNone

To view the source code for com.itextpdf.text.pdf PdfWriter PrintScalingNone.

Click Source Link

Document

A viewer preference

Usage

From source file:hr.ws4is.tn3812.drivers.listeners.PdfListener.java

License:Open Source License

@Override
public void onStart(final IControls controls) {

    this.controls = controls;

    Rectangle ps = null;//from   w  ww  . j  a  va2s. c om
    if (controls.getPageOrientation() == SCSPageOrientation.LANDSCAPE) {
        ps = PageSize.A4.rotate();
    } else {
        ps = PageSize.A4;
    }
    document = new Document(ps, 15, 0, 0, 0);

    font = new Font(courier, controls.getFontSize());
    fontBold = new Font(courier, controls.getFontSize());
    fontBold.setStyle(Font.BOLD);
    current = font;

    file = prepareFile();
    fos = open(file);
    try {
        printWriter = PdfWriter.getInstance(document, fos);
        printWriter.setViewerPreferences(PdfWriter.PrintScalingNone);
    } catch (DocumentException exception) {
        LOGGER.error(exception.getMessage(), exception);
    }

    document.open();

}