Example usage for com.itextpdf.text.html HtmlUtilities eliminateWhiteSpace

List of usage examples for com.itextpdf.text.html HtmlUtilities eliminateWhiteSpace

Introduction

In this page you can find the example usage for com.itextpdf.text.html HtmlUtilities eliminateWhiteSpace.

Prototype

public static String eliminateWhiteSpace(String content) 

Source Link

Document

Helper class that reduces the white space in a String

Usage

From source file:com.masscustsoft.service.ToPdf.java

License:Open Source License

/**
 * @see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#text(java.lang.String)
 */// ww  w  .j  a va 2s  .  c  o  m
public void text(String content) {
    if (skipText)
        return;
    if (currentParagraph == null) {
        currentParagraph = createParagraph();
    }
    if (!insidePRE) {
        // newlines and carriage returns are ignored
        if (content.trim().length() == 0 && content.indexOf(' ') < 0) {
            return;
        }
        content = HtmlUtilities.eliminateWhiteSpace(content);
    }
    Chunk chunk = createChunk(content);
    currentParagraph.add(chunk);
}