Example usage for com.itextpdf.text.html.simpleparser HTMLWorker IMG_PROCESSOR

List of usage examples for com.itextpdf.text.html.simpleparser HTMLWorker IMG_PROCESSOR

Introduction

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

Prototype

String IMG_PROCESSOR

To view the source code for com.itextpdf.text.html.simpleparser HTMLWorker IMG_PROCESSOR.

Click Source Link

Document

Key used to store the image processor in the providers map.

Usage

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

License:Open Source License

/**
 * Processes an Image.//from   www.  jav a 2s .  co m
 * @param img
 * @param attrs
 * @throws DocumentException
 * @since   5.0.6
 */
public void processImage(final Image img, final Map<String, String> attrs) throws DocumentException {
    ImageProcessor processor = (ImageProcessor) providers.get(HTMLWorker.IMG_PROCESSOR);
    if (processor == null || !processor.process(img, attrs, chain, document)) {
        String align = attrs.get(HtmlTags.ALIGN);
        if (align != null) {
            carriageReturn();
        }
        if (currentParagraph == null) {
            currentParagraph = createParagraph();
        }
        currentParagraph.add(new Chunk(img, 0, 0, true));
        currentParagraph.setAlignment(HtmlUtilities.alignmentValue(align));
        if (align != null) {
            carriageReturn();
        }
    }
}