Example usage for com.itextpdf.text.pdf PdfContentByte addFormXObj

List of usage examples for com.itextpdf.text.pdf PdfContentByte addFormXObj

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfContentByte addFormXObj.

Prototype

public PdfName addFormXObj(final PdfStream formXObj, final PdfName name, final double a, final double b,
        final double c, final double d, final double e, final double f) throws IOException 

Source Link

Document

Adds a form XObject to this content.

Usage

From source file:mkl.testarea.itext5.pdfcleanup.StrictPdfCleanUpProcessor.java

License:Open Source License

private void insertFormXObj(PdfContentByte canvas, PdfDictionary pageDict, PdfStream formXObj,
        List<Rectangle> clippingRects, Rectangle annotRect) throws IOException {
    PdfName xobjName = generateNameForXObj(pageDict);
    canvas.saveState();/*w w  w .j  a v a  2 s  .  c  om*/

    for (Rectangle rect : clippingRects) {
        canvas.rectangle(rect.getLeft(), rect.getBottom(), rect.getWidth(), rect.getHeight());
    }

    canvas.clip();
    canvas.newPath();

    canvas.addFormXObj(formXObj, xobjName, 1, 0, 0, 1, annotRect.getLeft(), annotRect.getBottom());

    canvas.restoreState();
}