I have two possible solutions, both of them need some changes to be made in 
xmlgraphics-commons:

First solution - doesn't add the pdfuaid extension schema automatically any 
more, so that the other extension schemas from the .fo get added properly; the 
pdfuaid extension schema then needs to be defined in the .fo file:
Changed PDFAExtensionAdapter so that the only thing done in the constructor is 
the call to super. The "pdfuaid" schema then needs to be defined manually in 
the report.fo.
(I also hat to modify a test class in order to be able to build the project; I 
simply disabled the test with @Ignore.)

Second solution - the pdfuaid extension schema gets added automatically, but 
the other schemas also get added because of the ArrayAddPropertyMerger rule; 
some minor changes were needed in order to make sure that the xmlLanguage and 
the parseType also get merged from one array to the other:
Changed PDFAExtensionAdapter so that the last few lines in the constructor look 
like this:
QName qname = new QName(namespace, SCHEMAS);
XMPProperty prop = new XMPProperty(qname, array);
XMPSchemaRegistry.getInstance().getSchema(namespace).getDefaultMergeRuleSet().addRule(qname,
 new ArrayAddPropertyMerger());
meta.setProperty(prop);
Which mean that any extension schemas in the .fo get added to the definitions 
and are not simply discarded.
I hat to define two new methods in XMPArray:
    public String getXMLLang(int idx) {
        return (String)this.xmllang.get(idx);
    }
    public String getParseType(int idx) {
        return this.parseTypes.get(idx);
    }
And I also changed the ArrayAddPropertyMerger, so that the language and 
parseType too get merged from one array to another. The last line now looks 
like this:
    array.add(otherArray.getValue(i), otherArray.getXMLLang(i), 
otherArray.getParseType(i));
(There was also a TODO comment right at this place, which I think meant exactly 
something like this modification.)

Both solutions work if I exchange the xmlgraphics-commons-2.10.jar from the 
fop/lib folder with the one I generated by building the modified project with 
"ant".
The generated PDF passes both validations, the one for PDF/A-2a and the one for 
PDF/UA-1.

Reply via email to