Example usage for org.apache.pdfbox.pdmodel.interactive.annotation PDAppearanceDictionary getCOSObject

List of usage examples for org.apache.pdfbox.pdmodel.interactive.annotation PDAppearanceDictionary getCOSObject

Introduction

In this page you can find the example usage for org.apache.pdfbox.pdmodel.interactive.annotation PDAppearanceDictionary getCOSObject.

Prototype

@Override
    public COSDictionary getCOSObject() 

Source Link

Usage

From source file:at.gv.egiz.pdfas.lib.impl.stamping.pdfbox.PDFAsVisualSignatureBuilder.java

License:EUPL

public void createAppearanceDictionary(PDXObjectForm holderForml, PDSignatureField signatureField,
        float degrees) throws IOException {

    PDAppearanceDictionary appearance = new PDAppearanceDictionary();
    appearance.getCOSObject().setDirect(true);

    PDAppearanceStream appearanceStream = new PDAppearanceStream(holderForml.getCOSStream());
    AffineTransform transform = new AffineTransform();
    transform.setToIdentity();/* ww w  .  j  a v a2s .  c  om*/
    transform.rotate(Math.toRadians(degrees));
    appearanceStream.setMatrix(transform);
    appearance.setNormalAppearance(appearanceStream);
    signatureField.getWidget().setAppearance(appearance);

    getStructure().setAppearanceDictionary(appearance);
    logger.debug("PDF appearance Dictionary has been created");

}

From source file:at.gv.egiz.pdfas.lib.impl.stamping.pdfbox2.PDFAsVisualSignatureBuilder.java

License:EUPL

public void createAppearanceDictionary(PDFormXObject holderForml, PDSignatureField signatureField,
        float degrees) throws IOException {

    PDAppearanceDictionary appearance = new PDAppearanceDictionary();
    appearance.getCOSObject().setDirect(true);

    PDAppearanceStream appearanceStream = new PDAppearanceStream(holderForml.getCOSStream());
    AffineTransform transform = new AffineTransform();
    transform.setToIdentity();/*w w  w .  j  av  a 2s . c  om*/
    transform.rotate(Math.toRadians(degrees));
    appearanceStream.setMatrix(transform);
    appearance.setNormalAppearance(appearanceStream);
    signatureField.getWidget().setAppearance(appearance);

    getStructure().setAppearanceDictionary(appearance);
    logger.debug("PDF appereance Dictionary has been created");

}