Example usage for com.itextpdf.text Chunk setHyphenation

List of usage examples for com.itextpdf.text Chunk setHyphenation

Introduction

In this page you can find the example usage for com.itextpdf.text Chunk setHyphenation.

Prototype

public Chunk setHyphenation(final HyphenationEvent hyphenation) 

Source Link

Document

sets the hyphenation engine to this Chunk.

Usage

From source file:se.billes.pdf.renderer.model.text.Phrase.java

License:Open Source License

public void onRender(com.itextpdf.text.Paragraph paragraph) {
    Font font = new Font(getBaseFont(), getFontSize());
    font.setColor(getBaseColor());//from  w w  w.  j  av  a 2  s .co  m
    if (getStyle() != null)
        font.setStyle(getStyle());
    String text = getText();
    if (text.length() == 0)
        text = " ";
    text = text.replace(">", ">");
    text = text.replace("&lt;", "<");

    Chunk chunk = new Chunk(text, font);
    if (getParagraph().getHyphenationAuto() != null) {
        chunk.setHyphenation(getParagraph().getHyphenationAuto());
    }
    chunk.setTextRise(getTextRise());
    chunk.setSkew(getSkewAlpha(), getSkewBeta());
    paragraph.add(chunk);
}