Package org.apache.xmlgraphics.xmp

Examples of org.apache.xmlgraphics.xmp.XMPArray


    private static void parseMetadata() throws TransformerException, SAXException {
        URL url = ParseMetadata.class.getResource("pdf-example.xmp");
        Metadata meta = XMPParser.parseXMP(url);
        XMPProperty prop;
        prop = meta.getProperty(XMPConstants.DUBLIN_CORE_NAMESPACE, "creator");
        XMPArray array;
        array = prop.getArrayValue();
        for (int i = 0, c = array.getSize(); i < c; i++) {
            System.out.println("Creator: " + array.getValue(i));
        }
        prop = meta.getProperty(XMPConstants.DUBLIN_CORE_NAMESPACE, "title");
        System.out.println("Title: " + prop.getValue());
        prop = meta.getProperty(XMPConstants.XMP_BASIC_NAMESPACE, "CreateDate");
        System.out.println("Creation Date: " + prop.getValue());
View Full Code Here


    private static void parseMetadata() throws TransformerException, SAXException {
        URL url = ParseMetadata.class.getResource("pdf-example.xmp");
        Metadata meta = XMPParser.parseXMP(url);
        XMPProperty prop;
        prop = meta.getProperty(XMPConstants.DUBLIN_CORE_NAMESPACE, "creator");
        XMPArray array;
        array = prop.getArrayValue();
        for (int i = 0, c = array.getSize(); i < c; i++) {
            System.out.println("Creator: " + array.getValue(i));
        }
        prop = meta.getProperty(XMPConstants.DUBLIN_CORE_NAMESPACE, "title");
        array = prop.getArrayValue();
        System.out.println("Default Title: " + array.getSimpleValue());
        System.out.println("German Title: " + array.getLangValue("de"));
        prop = meta.getProperty(XMPConstants.XMP_BASIC_NAMESPACE, "CreateDate");
        System.out.println("Creation Date: " + prop.getValue());
        prop = meta.getProperty(XMPConstants.XMP_BASIC_NAMESPACE, "CreatorTool");
        System.out.println("Creator Tool: " + prop.getValue());
        prop = meta.getProperty(XMPConstants.ADOBE_PDF_NAMESPACE, "Producer");
View Full Code Here

        if (existing == null) {
            //simply copy over
            target.setProperty(sourceProp);
        } else {
            existing.convertSimpleValueToArray(XMPArrayType.SEQ);
            XMPArray array = existing.getArrayValue();
            XMPArray otherArray = sourceProp.getArrayValue();
            if (otherArray == null) {
                if (sourceProp.getXMLLang() != null) {
                    array.add(sourceProp.getValue().toString(), sourceProp.getXMLLang());
                } else {
                    array.add(sourceProp.getValue());
                }
            } else {
                //TODO should be refined (xml:lang etc.)
                for (int i = 0, c = otherArray.getSize(); i < c; i++) {
                    array.add(otherArray.getValue(i));
                }
            }
        }
    }
View Full Code Here

    private static void parseMetadata() throws TransformerException, SAXException {
        URL url = ParseMetadata.class.getResource("pdf-example.xmp");
        Metadata meta = XMPParser.parseXMP(url);
        XMPProperty prop;
        prop = meta.getProperty(XMPConstants.DUBLIN_CORE_NAMESPACE, "creator");
        XMPArray array;
        array = prop.getArrayValue();
        for (int i = 0, c = array.getSize(); i < c; i++) {
            System.out.println("Creator: " + array.getValue(i));
        }
        prop = meta.getProperty(XMPConstants.DUBLIN_CORE_NAMESPACE, "title");
        array = prop.getArrayValue();
        System.out.println("Default Title: " + array.getSimpleValue());
        System.out.println("German Title: " + array.getLangValue("de"));
        prop = meta.getProperty(XMPConstants.XMP_BASIC_NAMESPACE, "CreateDate");
        System.out.println("Creation Date: " + prop.getValue());
        prop = meta.getProperty(XMPConstants.XMP_BASIC_NAMESPACE, "CreatorTool");
        System.out.println("Creator Tool: " + prop.getValue());
        prop = meta.getProperty(XMPConstants.ADOBE_PDF_NAMESPACE, "Producer");
View Full Code Here

    private static void dumpSomeMetadata(Metadata meta) {
        XMPProperty prop;
        prop = meta.getProperty(XMPConstants.DUBLIN_CORE_NAMESPACE, "creator");
        if (prop != null) {
            XMPArray array;
            array = prop.getArrayValue();
            for (int i = 0, c = array.getSize(); i < c; i++) {
                System.out.println("Creator: " + array.getValue(i));
            }
        }
        prop = meta.getProperty(XMPConstants.DUBLIN_CORE_NAMESPACE, "title");
        if (prop != null) {
            System.out.println("Title: " + prop.getValue());
View Full Code Here

        XMPProperty existing = target.getProperty(sourceProp.getName());
        if (existing == null) {
            //simply copy over
            target.setProperty(sourceProp);
        } else {
            XMPArray array = existing.convertSimpleValueToArray(XMPArrayType.SEQ);
            XMPArray otherArray = sourceProp.getArrayValue();
            if (otherArray == null) {
                if (sourceProp.getXMLLang() != null) {
                    array.add(sourceProp.getValue().toString(), sourceProp.getXMLLang());
                } else {
                    array.add(sourceProp.getValue());
                }
            } else {
                //TODO should be refined (xml:lang etc.)
                for (int i = 0, c = otherArray.getSize(); i < c; i++) {
                    array.add(otherArray.getValue(i));
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.xmlgraphics.xmp.XMPArray

Copyright © 2018 www.massapicom. 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.