pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Bailleul <gbm.baill...@gmail.com>
Subject Creating a PDF/A with PDFBOX
Date Sat, 12 Jan 2013 09:17:49 GMT
Hi,

I am trying to create a simple PDF/A with PDFBox and I am facing a
ColorSpace problem. I attach the source code to the mail. The
important part of the source is below [3].

The document is generated without error. It is readable with acrobat
reader. But it is considered as an invalid PDF/A with callas validator
[2] because the output intent is not defined [1].

Is there some documentation or examples on how to integrate
outputintent in my document ?

Thanks for your help,

Guillaume


[1] Callas returned error :
  Colors are not defined as neutral, and therefore do not always
appear the same.
  Device process color used but no PDF/A OutputIntent (1 match on 1 page)
  - Text BitstreamVeraSans-Roman 12.0 pt TrueType embedded (1 match)

[2] Callas online demo
http://www.datalogics.com/products/callas/callaspdfA-onlinedemo.asp

[3] The important part of the source :

            doc = new PDDocument();

            PDPage page = new PDPage();
            doc.addPage( page );

            PDFont font = PDTrueTypeFont.loadTTF(doc,
"../pdfbox/src/main/resources/org/apache/pdfbox/resources/ttf/ArialMT.ttf");

            PDPageContentStream contentStream = new
PDPageContentStream(doc, page);
            contentStream.beginText();
            contentStream.setFont( font, 12 );
            contentStream.moveTextPositionByAmount( 100, 700 );
            contentStream.drawString( message );
            contentStream.endText();
            contentStream.saveGraphicsState();
            contentStream.close();

            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);
            pdfaid.setConformance("B");
            pdfaid.setPart(1);
            pdfaid.setAbout("");
            metadata.importXMPMetadata(xmp);

            doc.save( file );

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message