Examples of XMPProperty


Examples of com.adobe.xmp.properties.XMPProperty

    int match = ((Integer) result[0]).intValue();
    final XMPNode itemNode = (XMPNode) result[1];

    if (match != XMPNodeUtils.CLT_NO_VALUES)
    {
      return new XMPProperty()
      {
        public String getValue()
        {
          return itemNode.getValue();
        }
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

            XMPError.BADXPATH);
      }

      final Object value = evaluateNodeValue(valueType, propNode);

      return new XMPProperty()
      {
        public String getValue()
        {
          return value != null ? value.toString() : null;
        }
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

        xmpMeta.process( tikaMetadata, GENERIC_MIMETYPE );

        XMPMeta xmp = xmpMeta.getXMPData();

        // check simple property
        XMPProperty prop = xmp.getProperty( XMPConst.NS_DC, "format" );
        assertNotNull( prop );
        assertEquals( GENERIC_MIMETYPE, prop.getValue() );

        // check lang alt
        prop = xmp.getLocalizedText( XMPConst.NS_DC, "title", null, XMPConst.X_DEFAULT );
        assertNotNull( prop );
        assertEquals( "title", prop.getValue() );

        // check array
        prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 1 );
        assertNotNull( prop );
        assertEquals( "keyword1", prop.getValue() );
        prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 2 );
        assertNotNull( prop );
        assertEquals( "keyword2", prop.getValue() );
    }
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

  public String getXMP(String[] xmppath) {
    try {
      if (xmp==null) return "";
      //System.err.println(xmp.dumpObject());
      XMPProperty xp = xmp.getProperty(xmppath[0], xmppath[1]);
      if (xp==null) return "";
      return xp.toString();
    } catch (XMPException e) {
      e.printStackTrace();
      return "";
    }
  }
View Full Code Here

Examples of com.itextpdf.xmp.properties.XMPProperty

    }

    private void readPdfAInfo() {
        byte[] metadata = null;
        XMPMeta xmpMeta = null;
        XMPProperty pdfaidConformance = null;
        XMPProperty pdfaidPart = null;
        try {
            metadata = reader.getMetadata();
            xmpMeta = XMPMetaParser.parse(metadata, null);
            pdfaidConformance = xmpMeta.getProperty(XMPConst.NS_PDFA_ID, "pdfaid:conformance");
            pdfaidPart = xmpMeta.getProperty(XMPConst.NS_PDFA_ID, "pdfaid:part");
        } catch (Throwable e) {
            throw new PdfAConformanceException(MessageLocalization.getComposedMessage("only.pdfa.documents.can.be.opened.in.PdfAStamper"));
        }
        if (pdfaidConformance == null || pdfaidPart == null) {
            throw new PdfAConformanceException(MessageLocalization.getComposedMessage("only.pdfa.documents.can.be.opened.in.PdfAStamper"));
        }
        switch (((PdfAConformance) pdfIsoConformance).getConformanceLevel()) {
            case PDF_A_1A:
            case PDF_A_1B:
                if (!"1".equals(pdfaidPart.getValue())) {
                    throw new PdfAConformanceException(MessageLocalization.getComposedMessage("only.pdfa.1.documents.can.be.opened.in.PdfAStamper", "1"));
                }
                break;
            case PDF_A_2A:
            case PDF_A_2B:
            case PDF_A_2U:
                if (!"2".equals(pdfaidPart.getValue())) {
                    throw new PdfAConformanceException(MessageLocalization.getComposedMessage("only.pdfa.1.documents.can.be.opened.in.PdfAStamper", "2"));
                }
                break;
            case PDF_A_3A:
            case PDF_A_3B:
            case PDF_A_3U:
                if (!"3".equals(pdfaidPart.getValue())) {
                    throw new PdfAConformanceException(MessageLocalization.getComposedMessage("only.pdfa.1.documents.can.be.opened.in.PdfAStamper", "3"));
                }
                break;
        }
View Full Code Here

Examples of com.itextpdf.xmp.properties.XMPProperty

    int match = ((Integer) result[0]).intValue();
    final XMPNode itemNode = (XMPNode) result[1];

    if (match != XMPNodeUtils.CLT_NO_VALUES)
    {
      return new XMPProperty()
      {
        public String getValue()
        {
          return itemNode.getValue();
        }
View Full Code Here

Examples of com.itextpdf.xmp.properties.XMPProperty

            XMPError.BADXPATH);
      }

      final Object value = evaluateNodeValue(valueType, propNode);

      return new XMPProperty()
      {
        public String getValue()
        {
          return value != null ? value.toString() : null;
        }
View Full Code Here

Examples of org.apache.xmlgraphics.xmp.XMPProperty

public class ParseMetadata {

    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());
        prop = meta.getProperty(XMPConstants.XMP_BASIC_NAMESPACE, "CreatorTool");
        System.out.println("Creator Tool: " + prop.getValue());
        prop = meta.getProperty(XMPConstants.ADOBE_PDF_NAMESPACE, "Producer");
        System.out.println("Producer: " + prop.getValue());
        prop = meta.getProperty(XMPConstants.ADOBE_PDF_NAMESPACE, "PDFVersion");
        System.out.println("PDF version: " + prop.getValue());
       
        StreamResult res = new StreamResult(System.out);
        XMPSerializer.writeXML(meta, res);
    }
View Full Code Here

Examples of org.apache.xmlgraphics.xmp.XMPProperty

        dc.addDate(new Date());
       
        meta2.mergeInto(meta1);
       
        Metadata meta = meta1;
        XMPProperty prop;
        dc = new DublinCoreAdapter(meta);
        String[] creators = dc.getCreators();
        for (int i = 0, c = creators.length; i < c; i++) {
            System.out.println("Creator: " + creators[i]);
        }
        System.out.println("Title: " + dc.getTitle());
        System.out.println("Title de: " + dc.getTitle("de"));
        System.out.println("Title en: " + dc.getTitle("en"));
        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");
        System.out.println("Producer: " + prop.getValue());
        prop = meta.getProperty(XMPConstants.ADOBE_PDF_NAMESPACE, "PDFVersion");
        System.out.println("PDF version: " + prop.getValue());
       
        XMPSerializer.writeXMPPacket(meta, System.out, false);
    }
View Full Code Here

Examples of org.apache.xmlgraphics.xmp.XMPProperty

public class ParseMetadata {

    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");
        System.out.println("Producer: " + prop.getValue());
        prop = meta.getProperty(XMPConstants.ADOBE_PDF_NAMESPACE, "PDFVersion");
        System.out.println("PDF version: " + prop.getValue());
       
        DublinCoreAdapter dc = DublinCoreSchema.getAdapter(meta);
        System.out.println("Default title: " + dc.getTitle());
        System.out.println("German title: " + dc.getTitle("de"));
       
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.