Example usage for com.lowagie.text.pdf PdfName Q

List of usage examples for com.lowagie.text.pdf PdfName Q

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfName Q.

Prototype

PdfName Q

To view the source code for com.lowagie.text.pdf PdfName Q.

Click Source Link

Document

A name

Usage

From source file:questions.forms.ChangeTextFieldAlignment.java

public static void main(String[] args) {
    try {/*from w  ww .j a v a 2s  .  c  om*/
        PdfReader reader = new PdfReader(RESOURCE);
        PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(RESULT));
        AcroFields form = stamper.getAcroFields();
        PdfDictionary dict = form.getFieldItem("Who").getMerged(0);
        dict.put(PdfName.Q, new PdfNumber(1));
        form.setField("Who", "Center of the World");
        stamper.close();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (DocumentException e) {
        e.printStackTrace();
    }
}