On 6/27/2025 2:22 PM, christian_kule...@me.com.INVALID wrote:
I have now spent some time trying to understand this deviation in behaviour.
In my opinion, we cannot parse `XMPMetaData` during validation because it is
not formatted correctly at the position of the lang attribute. If I comment
out the part that sets the DublinCore schema, the parsing works, but the
validation then fails. Can you explain to me why the `lang` attribute lang
is set correctly in Production and not in Test? As it is the same process,
the result should be the same.

I remember we had such a problem because something wrong in the class path. All I found was this, which had Apache FOP in the classpath:

https://lists.apache.org/thread/snzl9c655vzoyfyknxjofd6ff5r8nf4g

See also

https://www.mail-archive.com/users@pdfbox.apache.org/msg09256.html

possible solution:

https://stackoverflow.com/a/54588171/535646

and another:

https://issues.apache.org/jira/browse/PDFBOX-4817

please tell if this helps, if yes then I should add it to the FAQ or improve the javadoc, or maybe change the code so that a warning comes.

Tilman


https://imgur.com/a/FTgmlYl

```java

private static void createDublinCoreSchema(
     PDDocumentInformation docInfo,
     XMPMetadata xmpMetadata
) {
    if (docInfo.getTitle() != null) {
         DublinCoreSchema dublinCoreSchema =
xmpMetadata.createAndAddDublinCoreSchema();
         dublinCoreSchema.setTitle(docInfo.getTitle());
    }
}

```

## Metadata test | After PDFBox PDF/A conversion

<?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:pdfaid="http://www.aiim.org/pdfa/ns/id/";
rdf:about="">

       <pdfaid:part>1</pdfaid:part>

       <pdfaid:conformance>B</pdfaid:conformance>

     </rdf:Description>

     <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/";
rdf:about="">

       <dc:title>

         <rdf:Alt>

           <rdf:li
lang="x-default">Arbeitsunfähigkeitsbescheinigung</rdf:li>

         </rdf:Alt>

       </dc:title>

     </rdf:Description>

     <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/"; rdf:about="">

       <xmp:CreateDate>2025-06-27T11:10:21+00:00</xmp:CreateDate>

       <xmp:ModifyDate>2025-06-27T11:10:21+00:00</xmp:ModifyDate>

       <xmp:CreatorTool>Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0
Safari/537.36</xmp:CreatorTool>

     </rdf:Description>

     <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/"; rdf:about="">

       <pdf:Producer>Skia/PDF m136</pdf:Producer>

     </rdf:Description>

   </rdf:RDF>

</x:xmpmeta><?xpacket end="w"?>

## Metadata production | After PDFBox PDF/A conversion

<?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:pdfaid=http://www.aiim.org/pdfa/ns/id/
rdf:about="">

       <pdfaid:part>1</pdfaid:part>

       <pdfaid:conformance>B</pdfaid:conformance>

     </rdf:Description>

     <rdf:Description xmlns:dc=http://purl.org/dc/elements/1.1/ rdf:about="">

       <dc:title>

         <rdf:Alt>

           <rdf:li
xml:lang="x-default">Arbeitsunfähigkeitsbescheinigung</rdf:li>

         </rdf:Alt>

       </dc:title>

     </rdf:Description>

     <rdf:Description xmlns:xmp=http://ns.adobe.com/xap/1.0/ rdf:about="">

       <xmp:CreateDate>2025-06-27T11:13:43+00:00</xmp:CreateDate>

       <xmp:ModifyDate>2025-06-27T11:13:43+00:00</xmp:ModifyDate>

       <xmp:CreatorTool>Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0
Safari/537.36</xmp:CreatorTool>

     </rdf:Description>

     <rdf:Description xmlns:pdf=http://ns.adobe.com/pdf/1.3/ rdf:about="">

       <pdf:Producer>Skia/PDF m136</pdf:Producer>

     </rdf:Description>

   </rdf:RDF>

</x:xmpmeta><?xpacket end="w"?>




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to