Search in sources :

Example 1 with OECFType

use of org.apache.xmpbox.type.OECFType in project pdfbox by apache.

the class TestExifXmp method testGenerate.

@Test
public void testGenerate() throws Exception {
    XMPMetadata metadata = XMPMetadata.createXMPMetadata();
    TypeMapping tmapping = metadata.getTypeMapping();
    ExifSchema exif = new ExifSchema(metadata);
    metadata.addSchema(exif);
    OECFType oecf = new OECFType(metadata);
    oecf.addProperty(tmapping.createInteger(oecf.getNamespace(), oecf.getPrefix(), OECFType.COLUMNS, 14));
    oecf.setPropertyName(ExifSchema.OECF);
    exif.addProperty(oecf);
    XmpSerializer serializer = new XmpSerializer();
    serializer.serialize(metadata, new ByteArrayOutputStream(), false);
}
Also used : OECFType(org.apache.xmpbox.type.OECFType) XmpSerializer(org.apache.xmpbox.xml.XmpSerializer) XMPMetadata(org.apache.xmpbox.XMPMetadata) TypeMapping(org.apache.xmpbox.type.TypeMapping) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Test(org.junit.Test)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 XMPMetadata (org.apache.xmpbox.XMPMetadata)1 OECFType (org.apache.xmpbox.type.OECFType)1 TypeMapping (org.apache.xmpbox.type.TypeMapping)1 XmpSerializer (org.apache.xmpbox.xml.XmpSerializer)1 Test (org.junit.Test)1