Example usage for com.itextpdf.text.html.simpleparser HTMLTagProcessor startElement

List of usage examples for com.itextpdf.text.html.simpleparser HTMLTagProcessor startElement

Introduction

In this page you can find the example usage for com.itextpdf.text.html.simpleparser HTMLTagProcessor startElement.

Prototype

public abstract void startElement(HTMLWorker worker, String tag, Map<String, String> attrs)
        throws DocumentException, IOException;

Source Link

Document

Implement this class to tell the HTMLWorker what to do when an open tag is encountered.

Usage

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

License:Open Source License

/**
 * @see com.itextpdf.text.xml.simpleparser.SimpleXMLDocHandler#startElement(java.lang.String, java.util.Map)
 *//*w  w  w.j a v a2  s. com*/
public void startElement(final String tag, final Map<String, String> attrs) {
    HTMLTagProcessor htmlTag = tags.get(tag);
    if (htmlTag == null) {
        return;
    }
    // apply the styles to attrs
    style.applyStyle(tag, attrs);
    // deal with the style attribute
    StyleSheet.resolveStyleAttribute(attrs, chain);
    // process the tag
    try {
        htmlTag.startElement(this, tag, attrs);
    } catch (DocumentException e) {
        throw new ExceptionConverter(e);
    } catch (IOException e) {
        throw new ExceptionConverter(e);
    }
}