Example usage for org.apache.pdfbox.pdmodel.interactive.form PDField setReadOnly

List of usage examples for org.apache.pdfbox.pdmodel.interactive.form PDField setReadOnly

Introduction

In this page you can find the example usage for org.apache.pdfbox.pdmodel.interactive.form PDField setReadOnly.

Prototype

public void setReadOnly(boolean readonly) 

Source Link

Document

sets the field to be read-only.

Usage

From source file:org.olat.course.certificate.manager.CertificatePDFFormWorker.java

License:Apache License

private void fillField(String fieldName, String value, PDAcroForm acroForm) throws IOException {
    PDField field = acroForm.getField(fieldName);
    if (field != null) {
        if (value == null) {
            field.setValue("");
        } else {// w w  w  .j av  a  2  s  .co  m
            field.setValue(value);
        }

        field.setReadonly(true);
        field.setNoExport(true);
    }
}