Examples of XMPMeta


Examples of com.adobe.xmp.XMPMeta

    public void extract(@NotNull final String xmpString, @NotNull Metadata metadata)
    {
        XmpDirectory directory = metadata.getOrCreateDirectory(XmpDirectory.class);

        try {
            XMPMeta xmpMeta = XMPMetaFactory.parseFromString(xmpString);
            processXmpTags(directory, xmpMeta);
        } catch (XMPException e) {
            directory.addError("Error processing XMP data: " + e.getMessage());
        }
    }
View Full Code Here

Examples of com.adobe.xmp.XMPMeta

    // --- TESTS ---
    @Test
    public void process_genericConversion_ok() throws TikaException, XMPException {
        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.itextpdf.xmp.XMPMeta

        }
        if (xmp == null && altMetadata != null) {
          try {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                if (moreInfo == null || xmpMetadata != null) {
                    XMPMeta xmpMeta = XMPMetaFactory.parseFromBuffer(altMetadata);

                    PdfProperties.setProducer(xmpMeta, producer);
                    XmpBasicProperties.setModDate(xmpMeta, date.getW3CDate());
                    XmpBasicProperties.setMetaDataDate(xmpMeta, date.getW3CDate());
View Full Code Here

Examples of com.itextpdf.xmp.XMPMeta

        return COUNTER;
    }

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

Examples of com.itextpdf.xmp.XMPMeta

    @Override
    public void close(PdfWriter writer) {
        super.close(writer);
        boolean ok = false;
        XMPMeta xmpMeta = writer.getXmpWriter().getXmpMeta();
        try {
            String docFileName = xmpMeta.getPropertyString(PdfAXmpWriter.zugferdSchemaNS, PdfAXmpWriter.zugferdDocumentFileName);
            for (PdfFileSpecification attachment : attachments) {
                if (docFileName.equals(attachment.getAsString(PdfName.UF).toString())) {
                    PdfName relationship = attachment.getAsName(PdfName.AFRELATIONSHIP);
                    if (!AFRelationshipValue.Alternative.equals(relationship)) {
                        attachments.clear();
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.