Package org.apache.xmpbox.schema

Examples of org.apache.xmpbox.schema.PDFAIdentificationSchema


            cat.setMetadata(metadata);

            XMPMetadata xmp = XMPMetadata.createXMPMetadata();
            try
            {
                PDFAIdentificationSchema pdfaid = xmp.createAndAddPFAIdentificationSchema();
                pdfaid.setConformance("B");
                pdfaid.setPart(1);
                pdfaid.setAboutAsSimple("PDFBox PDFA sample");
                XmpSerializer serializer = new XmpSerializer();
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                serializer.serialize(xmp, baos, false);
                metadata.importXMPMetadata( baos.toByteArray() );
            }
View Full Code Here


     *
     * @return schema added in order to work on it
     */
    public PDFAIdentificationSchema createAndAddPFAIdentificationSchema()
    {
        PDFAIdentificationSchema pdfAId = new PDFAIdentificationSchema(this);
        pdfAId.setAboutAsSimple("");
        addSchema(pdfAId);
        return pdfAId;
    }
View Full Code Here

     * @throws ValidationException
     */
    public List<ValidationError> validatePDFAIdentifer(XMPMetadata metadata) throws ValidationException
    {
        List<ValidationError> ve = new ArrayList<ValidationError>();
        PDFAIdentificationSchema id = metadata.getPDFIdentificationSchema();
        if (id == null)
        {
            ve.add(new ValidationError(ERROR_METADATA_PDFA_ID_MISSING));
            return ve;
        }

        // According to the PDF/A specification, the prefix must be pdfaid for this schema.
        StructuredType stBasic = XMPBasicSchema.class.getAnnotation(StructuredType.class);
        StructuredType stPdfaIdent = PDFAIdentificationSchema.class.getAnnotation(StructuredType.class);
        if (!id.getPrefix().equals(stPdfaIdent.preferedPrefix()))
        {
            if (metadata.getSchema(stPdfaIdent.preferedPrefix(), stBasic.namespace()) == null)
            {
                ve.add(unexpectedPrefixFoundError(id.getPrefix(), stPdfaIdent.preferedPrefix(),
                        PDFAIdentificationSchema.class.getName()));
            }
            else
            {
                id = (PDFAIdentificationSchema) metadata.getSchema(stPdfaIdent.preferedPrefix(),
                        stPdfaIdent.namespace());
            }
        }
        checkConformanceLevel(ve, id.getConformance());
        checkPartNumber(ve, id.getPart());
        return ve;
    }
View Full Code Here

     * @throws ValidationException
     */
    public List<ValidationError> validatePDFAIdentifer(XMPMetadata metadata) throws ValidationException
    {
        List<ValidationError> ve = new ArrayList<ValidationError>();
        PDFAIdentificationSchema id = metadata.getPDFIdentificationSchema();
        if (id == null)
        {
            ve.add(new ValidationError(ERROR_METADATA_PDFA_ID_MISSING));
            return ve;
        }

        // According to the PDF/A specification, the prefix must be pdfaid for this schema.
        StructuredType stBasic = XMPBasicSchema.class.getAnnotation(StructuredType.class);
        StructuredType stPdfaIdent = PDFAIdentificationSchema.class.getAnnotation(StructuredType.class);
        if (!id.getPrefix().equals(stPdfaIdent.preferedPrefix()))
        {
            if (metadata.getSchema(stPdfaIdent.preferedPrefix(), stBasic.namespace()) == null)
            {
                ve.add(unexpectedPrefixFoundError(id.getPrefix(), stPdfaIdent.preferedPrefix(),
                        PDFAIdentificationSchema.class.getName()));
            }
            else
            {
                id = (PDFAIdentificationSchema) metadata.getSchema(stPdfaIdent.preferedPrefix(),
                        stPdfaIdent.namespace());
            }
        }
        checkConformanceLevel(ve, id.getConformance());
        checkPartNumber(ve, id.getPart());
        return ve;
    }
View Full Code Here

     *
     * @return schema added in order to work on it
     */
    public PDFAIdentificationSchema createAndAddPFAIdentificationSchema()
    {
        PDFAIdentificationSchema pdfAId = new PDFAIdentificationSchema(this);
        pdfAId.setAboutAsSimple("");
        addSchema(pdfAId);
        return pdfAId;
    }
View Full Code Here

            cat.setMetadata(metadata);

            XMPMetadata xmp = XMPMetadata.createXMPMetadata();
            try
            {
                PDFAIdentificationSchema pdfaid = xmp.createAndAddPFAIdentificationSchema();
                pdfaid.setConformance("B");
                pdfaid.setPart(1);
                pdfaid.setAboutAsSimple("PDFBox PDFA sample");
                XmpSerializer serializer = new XmpSerializer();
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                serializer.serialize(xmp, baos, false);
                metadata.importXMPMetadata( baos.toByteArray() );
            }
View Full Code Here

     *
     * @return schema added in order to work on it
     */
    public PDFAIdentificationSchema createAndAddPFAIdentificationSchema()
    {
        PDFAIdentificationSchema pdfAId = new PDFAIdentificationSchema(this);
        pdfAId.setAboutAsSimple("");
        addSchema(pdfAId);
        return pdfAId;
    }
View Full Code Here

TOP

Related Classes of org.apache.xmpbox.schema.PDFAIdentificationSchema

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.