Example usage for com.lowagie.text.xml SAXiTextHandler setControlOpenClose

List of usage examples for com.lowagie.text.xml SAXiTextHandler setControlOpenClose

Introduction

In this page you can find the example usage for com.lowagie.text.xml SAXiTextHandler setControlOpenClose.

Prototype


public void setControlOpenClose(boolean controlOpenClose) 

Source Link

Document

Sets the parameter that allows you to enable/disable the control over the Document.open() and Document.close() method.

Usage

From source file:org.apache.cocoon.serialization.iTextSerializer.java

License:Apache License

public void setOutputStream(OutputStream out) {
    this.document = new Document(this.pageSize);

    try {// w  w w. j a v a2s  .  c  o  m
        PdfWriter.getInstance(document, out);
    } catch (Exception e) {
        getLogger().error("cannot create pdf writer instance", e);
        //TC: FIXME! shouldn't we throw an exception here? what kind?
    }

    SAXiTextHandler handler = new SAXiTextHandler(document);
    handler.setControlOpenClose(true);
    this.contentHandler = handler;
}