PDF Accessibility | 'Title - Failed' Error

2019-08-13 20:10发布

问题:

I am generating a PDF document from an XML using XSL template in Apache FOP API. My applications requires the PDF documents to be generated dynamically.

Despite of adding the title (code snippet below), I am getting 'Title - Failed' error when checked for Accessibility (full check) in Adobe Acrobat Pro 11.

<fo:declarations>
            <x:xmpmeta xmlns:x="adobe:ns:meta/">
                <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                    <rdf:Description rdf:about=""
      xmlns:dc="http://purl.org/dc/elements/1.1/">
                        <!-- Dublin Core properties go here -->
                        <dc:title>Document title</dc:title>
                        <dc:creator>Document author</dc:creator>
                        <dc:description>Document subject</dc:description>
                    </rdf:Description>
                    <rdf:Description rdf:about=""
      xmlns:xmp="http://ns.adobe.com/xap/1.0/">
                        <!-- XMP properties go here -->
                        <xmp:CreatorTool>Tool used to make the PDF</xmp:CreatorTool>
                    </rdf:Description>
                </rdf:RDF>
            </x:xmpmeta>
        </fo:declarations>

回答1:

In Adobe Acrobat If I go to File --> Properties --> Initial View --> Select 'Document Title' in Show, the error is fixed. But I am not able to find anything to do the same thing programmatically, neither in XSL template nor in java code.



回答2:

It looks like this issue has been fixed, probably in version 2.1. I just upgraded to FOP 2.2 after having this same issue while using version 1.1, and I'm pleased to report that everything works as expected now after opening a dynamically-generated PDF-UA file with Adobe Acrobat XI Pro.



标签: xsl-fo