Example usage for org.apache.pdfbox.cos COSDictionary setBoolean

List of usage examples for org.apache.pdfbox.cos COSDictionary setBoolean

Introduction

In this page you can find the example usage for org.apache.pdfbox.cos COSDictionary setBoolean.

Prototype

public void setBoolean(COSName key, boolean value) 

Source Link

Document

This will set an item in the dictionary.

Usage

From source file:se.streamsource.streamflow.web.application.pdf.Underlay.java

License:Apache License

private PDXObjectForm importAsXObject(PDDocument target, PDPage page) throws IOException {
    final PDStream xobjectStream = new PDStream(target, page.getContents().createInputStream(), false);
    final PDXObjectForm xobject = new PDXObjectForm(xobjectStream);

    xobject.setResources(page.findResources());
    xobject.setBBox(page.findCropBox());

    COSDictionary group = new COSDictionary();
    group.setName("S", "Transparency");
    group.setBoolean(COSName.getPDFName("K"), true);
    xobject.getCOSStream().setItem(COSName.getPDFName("Group"), group);

    return xobject;
}