pdfa3-sample/src/main/java/pdfbox/PDFA3File.java
private PDDocumentCatalog makeA3compliant(PDDocument doc) throws IOException, TransformerException
  {
    PDDocumentCatalog cat = doc.getDocumentCatalog();
    PDMetadata metadata = new PDMetadata(doc);
    cat.setMetadata(metadata);
    // jempbox version
    XMPMetadata xmp = new XMPMetadata();
    XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
    xmp.addSchema(pdfaid);

    XMPSchemaDublinCore dc = xmp.addDublinCoreSchema();
    String creator = System.getProperty("user.name");
    String producer = "PDFBOX";
    dc.addCreator(creator);
    dc.setAbout("");

    XMPSchemaBasic xsb = xmp.addBasicSchema();
    xsb.setAbout("");

    xsb.setCreatorTool(creator);
    xsb.setCreateDate(GregorianCalendar.getInstance());
    // PDDocumentInformation pdi=doc.getDocumentInformation();
    PDDocumentInformation pdi = new PDDocumentInformation();
    pdi.setProducer(producer);
    pdi.setAuthor(creator);
    doc.setDocumentInformation(pdi);

    XMPSchemaPDF pdf = xmp.addPDFSchema();
    pdf.setProducer(producer);
    pdf.setAbout("");

    // Mandatory: PDF-A3 is tagged PDF which has to be expressed using a
    // MarkInfo dictionary (PDF A/3 Standard sec. 6.7.2.2)
    PDMarkInfo markinfo = new PDMarkInfo();
    markinfo.setMarked(true);
    doc.getDocumentCatalog().setMarkInfo(markinfo);

    pdfaid.setPart(3);
    pdfaid.setConformance("A");/*
                                * All files are PDF/A-3, setConformance refers
                                * to the level conformance, e.g. PDF/A-3-B where
                                * B means only visually preservable, U means
                                * visually and unicode preservable and A -like
                                * in this case- means full compliance, i.e.
                                * visually, unicode and structurally preservable
                                */
    pdfaid.setAbout("");
    metadata.importXMPMetadata(xmp);
    return cat;
  }
/**
   * Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
   * metadata level, this will not e.g. convert graphics to JPG-2000)
   */
Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
metadata level, this will not e.g. convert graphics to JPG-2000)
Makes A PDF / A3a - compliant document from a PDF - A1 compliant document ( on the metadata level this will not e . g . convert graphics to JPG - 2000 )
private PDDocumentCatalog makeA3compliant(PDDocument doc) throws IOException, TransformerException
  {
    PDDocumentCatalog cat = doc.getDocumentCatalog();
    PDMetadata metadata = new PDMetadata(doc);
    cat.setMetadata(metadata);
    XMPMetadata xmp = new XMPMetadata();
    XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
    xmp.addSchema(pdfaid);
    XMPSchemaDublinCore dc = xmp.addDublinCoreSchema();
    String creator = System.getProperty("user.name");
    String producer = "PDFBOX";
    dc.addCreator(creator);
    dc.setAbout("");
    XMPSchemaBasic xsb = xmp.addBasicSchema();
    xsb.setAbout("");
    xsb.setCreatorTool(creator);
    xsb.setCreateDate(GregorianCalendar.getInstance());
    PDDocumentInformation pdi = new PDDocumentInformation();
    pdi.setProducer(producer);
    pdi.setAuthor(creator);
    doc.setDocumentInformation(pdi);
    XMPSchemaPDF pdf = xmp.addPDFSchema();
    pdf.setProducer(producer);
    pdf.setAbout("");
    PDMarkInfo markinfo = new PDMarkInfo();
    markinfo.setMarked(true);
    doc.getDocumentCatalog().setMarkInfo(markinfo);
    pdfaid.setPart(3);
    pdfaid.setConformance("A");/*
                                * All files are PDF/A-3, setConformance refers
                                * to the level conformance, e.g. PDF/A-3-B where
                                * B means only visually preservable, U means
                                * visually and unicode preservable and A -like
                                * in this case- means full compliance, i.e.
                                * visually, unicode and structurally preservable
                                */
    pdfaid.setAbout("");
    metadata.importXMPMetadata(xmp);
    return cat;
  }
private PDDocumentCatalog makeA3compliant ( PDDocument doc ) throws IOException , TransformerException { PDDocumentCatalog cat = doc . getDocumentCatalog ( ) ; PDMetadata metadata = new PDMetadata ( doc ) ; cat . setMetadata ( metadata ) ; XMPMetadata xmp = new XMPMetadata ( ) ; XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId ( xmp ) ; xmp . addSchema ( pdfaid ) ; XMPSchemaDublinCore dc = xmp . addDublinCoreSchema ( ) ; String creator = System . getProperty ( "user.name" ) ; String producer = "PDFBOX" ; dc . addCreator ( creator ) ; dc . setAbout ( "" ) ; XMPSchemaBasic xsb = xmp . addBasicSchema ( ) ; xsb . setAbout ( "" ) ; xsb . setCreatorTool ( creator ) ; xsb . setCreateDate ( GregorianCalendar . getInstance ( ) ) ; PDDocumentInformation pdi = new PDDocumentInformation ( ) ; pdi . setProducer ( producer ) ; pdi . setAuthor ( creator ) ; doc . setDocumentInformation ( pdi ) ; XMPSchemaPDF pdf = xmp . addPDFSchema ( ) ; pdf . setProducer ( producer ) ; pdf . setAbout ( "" ) ; PDMarkInfo markinfo = new PDMarkInfo ( ) ; markinfo . setMarked ( true ) ; doc . getDocumentCatalog ( ) . setMarkInfo ( markinfo ) ; pdfaid . setPart ( 3 ) ; pdfaid . setConformance ( "A" ) ; /*
                                * All files are PDF/A-3, setConformance refers
                                * to the level conformance, e.g. PDF/A-3-B where
                                * B means only visually preservable, U means
                                * visually and unicode preservable and A -like
                                * in this case- means full compliance, i.e.
                                * visually, unicode and structurally preservable
                                */ pdfaid . setAbout ( "" ) ; metadata . importXMPMetadata ( xmp ) ; return cat ; }
Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
 metadata level, this will not e.g.
Makes A PDF / A3a - compliant document from a PDF - A1 compliant document ( on the metadata level this will not e . g .
// jempbox version // PDDocumentInformation pdi=doc.getDocumentInformation(); // Mandatory: PDF-A3 is tagged PDF which has to be expressed using a // MarkInfo dictionary (PDF A/3 Standard sec. 6.7.2.2)