Example usage for com.lowagie.text.pdf BaseField setFontSize

List of usage examples for com.lowagie.text.pdf BaseField setFontSize

Introduction

In this page you can find the example usage for com.lowagie.text.pdf BaseField setFontSize.

Prototype

public void setFontSize(float fontSize) 

Source Link

Document

Sets the font size.

Usage

From source file:buckley.compile.TextModifier.java

License:Apache License

public void modify(BaseField iTextField, TextField field, Document document) {
    FontRegistry fontRegistry = document.getFontRegistry();

    BaseFont font = fontRegistry.getDefaultFont();
    float size = fontRegistry.getDefaultFontSize();

    if (field.getFontName() != null) {
        font = fontRegistry.getFont(field.getFontName());
    }/*  ww  w.ja  va  2 s  . c o  m*/

    if (field.getFontSize() != null && field.getFontSize() > 0.0f) {
        size = field.getFontSize();
    }

    iTextField.setFont(font);
    iTextField.setFontSize(size);
}