Examples of XMPMetadata


Examples of org.apache.xmpbox.XMPMetadata

    }

    @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);
View Full Code Here

Examples of org.apache.xmpbox.XMPMetadata

        catch (IOException e)
        {
            throw new XmpParsingException(ErrorType.Undefined, "Failed to parse", e);
        }
        // document.normalizeDocument();
        XMPMetadata xmp = null;

        // Start reading
        removeComments(document);
        Node node = document.getFirstChild();
View Full Code Here

Examples of org.apache.xmpbox.XMPMetadata

    public static final String MY_PREFIX = "test";

    @Before
    public void before() throws Exception
    {
        XMPMetadata xmp = XMPMetadata.createXMPMetadata();
        st = new MyStructuredType(xmp, MY_NS, MY_PREFIX);
    }
View Full Code Here

Examples of org.apache.xmpbox.XMPMetadata

                if (meta != null)
                {
                    DomXmpParser xmpParser = new DomXmpParser();
                    try
                    {
                        XMPMetadata metadata = xmpParser.parse(meta.createInputStream());

                        DublinCoreSchema dc = metadata.getDublinCoreSchema();
                        if (dc != null)
                        {
                            display("Title:", dc.getTitle());
                            display("Description:", dc.getDescription());
                            listString("Creators: ", dc.getCreators());
                            listCalendar("Dates:", dc.getDates());
                            listString("Subjects:", dc.getSubjects());
                        }

                        AdobePDFSchema pdf = metadata.getAdobePDFSchema();
                        if (pdf != null)
                        {
                            display("Keywords:", pdf.getKeywords());
                            display("PDF Version:", pdf.getPDFVersion());
                            display("PDF Producer:", pdf.getProducer());
                        }

                        XMPBasicSchema basic = metadata.getXMPBasicSchema();
                        if (basic != null)
                        {
                            display("Create Date:", basic.getCreateDate());
                            display("Modify Date:", basic.getModifyDate());
                            display("Creator Tool:", basic.getCreatorTool());
View Full Code Here

Examples of org.apache.xmpbox.XMPMetadata

    }

    @Test
    public void testArrayList() throws Exception
    {
        XMPMetadata meta = XMPMetadata.createXMPMetadata();
        ArrayProperty newSeq = meta.getTypeMapping().createArrayProperty(null, "nsSchem", "seqType", Cardinality.Seq);
        TypeMapping tm = meta.getTypeMapping();
        TextType li1 = tm.createText(null, "rdf", "li", "valeur1");
        TextType li2 = tm.createText(null, "rdf", "li", "valeur2");
        newSeq.getContainer().addProperty(li1);
        newSeq.getContainer().addProperty(li2);
        schem.addProperty(newSeq);
View Full Code Here

Examples of org.apache.xmpbox.XMPMetadata

    @Test
    public void testRdfAboutFound() throws Exception
    {
        InputStream fis = DomXmpParser.class.getResourceAsStream("/validxmp/emptyli.xml");
        DomXmpParser xdb = new DomXmpParser();
        XMPMetadata meta = xdb.parse(fis);
        List<XMPSchema> schemas = meta.getAllSchemas();
        for (XMPSchema xmpSchema : schemas)
        {
            Assert.assertNotNull(xmpSchema.getAboutAttribute());
        }
    }
View Full Code Here

Examples of org.apache.xmpbox.XMPMetadata

    @Test
    public void testWihtAttributesAsProperties() throws Exception
    {
        InputStream fis = DomXmpParser.class.getResourceAsStream("/validxmp/attr_as_props.xml");
        DomXmpParser xdb = new DomXmpParser();
        XMPMetadata meta = xdb.parse(fis);

        AdobePDFSchema pdf = meta.getAdobePDFSchema();
        Assert.assertEquals("GPL Ghostscript 8.64", pdf.getProducer());

        DublinCoreSchema dc = meta.getDublinCoreSchema();
        Assert.assertEquals("application/pdf", dc.getFormat());

        XMPBasicSchema basic = meta.getXMPBasicSchema();
        Assert.assertNotNull(basic.getCreateDate());

    }
View Full Code Here

Examples of org.apache.xmpbox.XMPMetadata

    public void testSpaceTextValues () throws Exception {
        // check values with spaces at start or end
        // in this case, the value should not be trimmed
        InputStream is = DomXmpParser.class.getResourceAsStream("/validxmp/only_space_fields.xmp");
        DomXmpParser xdb = new DomXmpParser();
        XMPMetadata meta = xdb.parse(is);
        // check producer
        Assert.assertEquals(" ", meta.getAdobePDFSchema().getProducer());
        // check creator tool
        Assert.assertEquals("Canon ",meta.getXMPBasicSchema().getCreatorTool());

    }
View Full Code Here

Examples of org.apache.xmpbox.XMPMetadata

            PDDocument document = ctx.getDocument();

            byte[] tmp = getXpacket(document.getDocument());
            DomXmpParser builder;
            builder = new DomXmpParser();
            XMPMetadata metadata;
            metadata = builder.parse(tmp);
            ctx.setMetadata(metadata);

            // 6.7.5 no deprecated attribute in xpacket processing instruction
            if (metadata.getXpacketBytes() != null)
            {
                addValidationError(ctx, new ValidationError(PreflightConstants.ERROR_METADATA_XPACKET_DEPRECATED,
                        "bytes attribute is forbidden"));
            }
            if (metadata.getXpacketEncoding() != null)
            {
                addValidationError(ctx, new ValidationError(PreflightConstants.ERROR_METADATA_XPACKET_DEPRECATED,
                        "encoding attribute is forbidden"));
            }
View Full Code Here

Examples of org.apache.xmpbox.XMPMetadata

    }

    @Test
    public void testArrayList() throws Exception
    {
        XMPMetadata meta = XMPMetadata.createXMPMetadata();
        ArrayProperty newSeq = meta.getTypeMapping().createArrayProperty(null, "nsSchem", "seqType", Cardinality.Seq);
        TypeMapping tm = meta.getTypeMapping();
        TextType li1 = tm.createText(null, "rdf", "li", "valeur1");
        TextType li2 = tm.createText(null, "rdf", "li", "valeur2");
        newSeq.getContainer().addProperty(li1);
        newSeq.getContainer().addProperty(li2);
        schem.addProperty(newSeq);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.