Example usage for org.apache.pdfbox.cos COSName CREATOR

List of usage examples for org.apache.pdfbox.cos COSName CREATOR

Introduction

In this page you can find the example usage for org.apache.pdfbox.cos COSName CREATOR.

Prototype

COSName CREATOR

To view the source code for org.apache.pdfbox.cos COSName CREATOR.

Click Source Link

Usage

From source file:org.apache.camel.component.fop.FopEndpointTest.java

License:Apache License

@Test
public void setPDFRenderingMetadataPerDocument() throws Exception {
    Endpoint endpoint = context().getEndpoint("fop:application/pdf");
    Producer producer = endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
    exchange.getIn().setHeader("CamelFop.Render.Creator", "Test User");
    exchange.getIn().setBody(FopHelper.decorateTextWithXSLFO("Test Content"));

    producer.process(exchange);/*from   w  w w .  j  a v  a  2  s  .  c o m*/
    PDDocument document = getDocumentFrom(exchange);
    String creator = FopHelper.getDocumentMetadataValue(document, COSName.CREATOR);
    assertEquals("Test User", creator);
}

From source file:org.apache.camel.FopEndpointTest.java

License:Apache License

@Test
public void setPDFRenderingMetadataPerDocument() throws Exception {
    Endpoint endpoint = context().getEndpoint("fop:application/pdf");
    Producer producer = endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
    exchange.getIn().setHeader("CamelFop.render.Creator", "Test User");
    exchange.getIn().setBody(FopHelper.decorateTextWithXSLFO("Test Content"));

    producer.process(exchange);//from  w w  w.ja v a2s  .c  o  m
    PDDocument document = getDocumentFrom(exchange);
    String creator = FopHelper.getDocumentMetadataValue(document, COSName.CREATOR);
    assertEquals("Test User", creator);
}