Example usage for com.lowagie.text Chunk setNewPage

List of usage examples for com.lowagie.text Chunk setNewPage

Introduction

In this page you can find the example usage for com.lowagie.text Chunk setNewPage.

Prototype


public Chunk setNewPage() 

Source Link

Document

Sets a new page tag..

Usage

From source file:org.areasy.common.doclet.document.tags.TagA.java

License:Open Source License

public Element[] openTagElements() {
    String addr = getAttribute("href");
    String name = getAttribute("name");

    if (addr != null && addr.equalsIgnoreCase("newpage")) {
        Chunk anchor = new Chunk("");
        anchor.setNewPage();

        return new Element[] { anchor };
    } else if (name != null && name.equalsIgnoreCase("bookmark")) {
        String label = getAttribute("label");

        String destinationName = null;
        if (HtmlParserWrapper.getRootBookmarkEntry() != null) {
            String target = getAttribute("target");
            destinationName = HtmlParserWrapper.getRootBookmarkEntry().addBookmarkEntry(target, label);
        } else {//from w  ww.j  a  v  a2 s . c  om
            destinationName = Destinations.createAnchorDestination(State.getCurrentFile(), label);
            Bookmarks.addRootBookmark(label, destinationName);
        }

        Chunk anchor = PDFUtility.createAnchor(destinationName);

        return new Element[] { anchor };
    } else if (name != null && name.length() > 0) {
        String dest = Destinations.createAnchorDestination(State.getCurrentFile(), name);

        setLink(false);
        Phrase anchor = new Phrase(PDFUtility.createAnchor(dest, getFont()));

        return new Element[] { anchor };
    }

    return null;
}