You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Stenersen, Björn WI (Fa. Kessler Beratung)" <Bj...@schufa.de> on 2013/08/01 13:56:17 UTC

Problem with XMP-Metadata and PDF/A-Validation

Hello,
i am trying to create a pdf/a with FOP 1.1, but the validation of the generated PDF always fails due to corrupt xmp-metadata.
I tried several Validators, all of them report the same error:

XMP metadata: Property 'language' in predefined XMP schema 'http://purl.org/dc/elements/1.1/' for PDF/A has wrong value type (must be 'rdf:bag')
(http://www.pdflib.com/knowledge-base/xmp-metadata/free-xmp-validator/)

So I tried to fix the problem by declaring the language-property in my fo:declarations-section:

<fo:declarations>
	<x:xmpmeta xmlns:x="adobe:ns:meta/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
		<dc:creator>
			<rdf:Seq>
				<rdf:li>
					CREATOR
				</rdf:li>
			</rdf:Seq>
		</dc:creator>
		<dc:language>
			<rdf:Bag>
				<rdf:li>
					de-DE
				</rdf:li>
			</rdf:Bag>
		</dc:language>
		<dc:date>
		<rdf:Seq>
			<rdf:li>1999-08-01T12:56:02+02:00</rdf:li>
		</rdf:Seq>
	 </dc:date>
		<xmp:CreatorTool>My App</xmp:CreatorTool>
	</x:xmpmeta>
</fo:declarations>

In the resulting PDF the metadata looks like this:

<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
         <dc:format>application/pdf</dc:format>
         <dc:language>x-unknown</dc:language>
         <dc:creator>
            <rdf:Seq>
               <rdf:li>CREATOR</rdf:li>
            </rdf:Seq>
         </dc:creator>
         <dc:date>
            <rdf:Seq>
               <rdf:li>1999-08-01T12:56:02+02:00</rdf:li>
               <rdf:li>2013-08-01T13:53:08+02:00</rdf:li>
            </rdf:Seq>
         </dc:date>
      </rdf:Description>
      <rdf:Description xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/" rdf:about="">
         <pdfaid:conformance>B</pdfaid:conformance>
         <pdfaid:part>1</pdfaid:part>
      </rdf:Description>
      <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
         <pdf:PDFVersion>1.4</pdf:PDFVersion>
         <pdf:Producer>Apache FOP Version SVN tags/fop-1_1</pdf:Producer>
      </rdf:Description>
      <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
         <xmp:CreateDate>2013-08-01T13:53:08+02:00</xmp:CreateDate>
         <xmp:CreatorTool>My App</xmp:CreatorTool>
         <xmp:MetadataDate>2013-08-01T13:53:08+02:00</xmp:MetadataDate>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>
<?xpacket end="r"?>

Is anyone experiencing the same problem? Any tips how to fix this?

Thanks Björn

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem with XMP-Metadata and PDF/A-Validation

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
On 8/5/2013 2:24 AM, stenersen wrote:
> I just tried to use FOP 1.0 and it works! 
> So i had a look at the code and found out that in the constructor of
> org.apache.fop.pdf.PDFRoot:75 the line 
>
> setLanguage("x-unknown");
>
> overrides my property. This line is new in FOP 1.1. Is this a bug?

Hi, Björn-

Good catch.  I should have mentioned that I used version 1.0.

-Terence Bandoian



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem with XMP-Metadata and PDF/A-Validation

Posted by stenersen <bj...@kessler-beratung.de>.
I just tried to use FOP 1.0 and it works! 
So i had a look at the code and found out that in the constructor of
org.apache.fop.pdf.PDFRoot:75 the line 

setLanguage("x-unknown");

overrides my property. This line is new in FOP 1.1. Is this a bug?




--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Problem-with-XMP-Metadata-and-PDF-A-Validation-tp38973p38982.html
Sent from the FOP - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem with XMP-Metadata and PDF/A-Validation

Posted by stenersen <bj...@kessler-beratung.de>.
Hi Terence,
i tried your syntax but nothing changed.

<dc:language>
	<rdf:Bag>
		<rdf:li>
			de-DE
		</rdf:li>
	</rdf:Bag>
</dc:language>

is sill removed by fop and printed as 

<dc:language>x-unknown</dc:language>

to the xmp-metadata.



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Problem-with-XMP-Metadata-and-PDF-A-Validation-tp38973p38981.html
Sent from the FOP - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem with XMP-Metadata and PDF/A-Validation

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
On 8/1/2013 6:56 AM, "Stenersen, Björn WI \(Fa. Kessler Beratung\)" wrote:
> Hello,
> i am trying to create a pdf/a with FOP 1.1, but the validation of the generated PDF always fails due to corrupt xmp-metadata.
> I tried several Validators, all of them report the same error:
>
> XMP metadata: Property 'language' in predefined XMP schema 'http://purl.org/dc/elements/1.1/' for PDF/A has wrong value type (must be 'rdf:bag')
> (http://www.pdflib.com/knowledge-base/xmp-metadata/free-xmp-validator/)
>
> So I tried to fix the problem by declaring the language-property in my fo:declarations-section:
>
> <fo:declarations>
> 	<x:xmpmeta xmlns:x="adobe:ns:meta/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> 		<dc:creator>
> 			<rdf:Seq>
> 				<rdf:li>
> 					CREATOR
> 				</rdf:li>
> 			</rdf:Seq>
> 		</dc:creator>
> 		<dc:language>
> 			<rdf:Bag>
> 				<rdf:li>
> 					de-DE
> 				</rdf:li>
> 			</rdf:Bag>
> 		</dc:language>
> 		<dc:date>
> 		<rdf:Seq>
> 			<rdf:li>1999-08-01T12:56:02+02:00</rdf:li>
> 		</rdf:Seq>
> 	 </dc:date>
> 		<xmp:CreatorTool>My App</xmp:CreatorTool>
> 	</x:xmpmeta>
> </fo:declarations>
>
> In the resulting PDF the metadata looks like this:
>
> <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/">
>    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
>       <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
>          <dc:format>application/pdf</dc:format>
>          <dc:language>x-unknown</dc:language>
>          <dc:creator>
>             <rdf:Seq>
>                <rdf:li>CREATOR</rdf:li>
>             </rdf:Seq>
>          </dc:creator>
>          <dc:date>
>             <rdf:Seq>
>                <rdf:li>1999-08-01T12:56:02+02:00</rdf:li>
>                <rdf:li>2013-08-01T13:53:08+02:00</rdf:li>
>             </rdf:Seq>
>          </dc:date>
>       </rdf:Description>
>       <rdf:Description xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/" rdf:about="">
>          <pdfaid:conformance>B</pdfaid:conformance>
>          <pdfaid:part>1</pdfaid:part>
>       </rdf:Description>
>       <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
>          <pdf:PDFVersion>1.4</pdf:PDFVersion>
>          <pdf:Producer>Apache FOP Version SVN tags/fop-1_1</pdf:Producer>
>       </rdf:Description>
>       <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
>          <xmp:CreateDate>2013-08-01T13:53:08+02:00</xmp:CreateDate>
>          <xmp:CreatorTool>My App</xmp:CreatorTool>
>          <xmp:MetadataDate>2013-08-01T13:53:08+02:00</xmp:MetadataDate>
>       </rdf:Description>
>    </rdf:RDF>
> </x:xmpmeta>
> <?xpacket end="r"?>
>
> Is anyone experiencing the same problem? Any tips how to fix this?
>
> Thanks Björn
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>


Hi, Björn-

I used something like this:

        <fo:declarations>
            <x:xmpmeta xmlns:x="adobe:ns:meta/">
                <rdf:RDF
                    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                    xmlns:dc="http://purl.org/dc/elements/1.1/">

                    <rdf:Description rdf:about="">

                        <dc:title>
                            <rdf:Alt>
                                <rdf:li xml:lang="x-default">
                                    <xsl:value-of select="//title" />
                                </rdf:li>
                            </rdf:Alt>
                        </dc:title>

                        ...

                    </rdf:Description>

                </rdf:RDF>
            </x:xmpmeta>
        </fo:declarations>

and was able to successfully validate the output as PDF/A.

-Terence Bandoian


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org