Hi Tilman,
now the metadata are written to the PDF, but maybe at the wrong
position. If I compare it to the original PDF the XMP stream is written
in the beginning of the document. The original contains the stream at
the end, but starting with a "xpacket" tag. This tag is missing from
modified document. Don't know if it's relevant. At least my PDF viewer
shows the modified document without metadata and doesn't recognize it as
a PDF/A. I've uploaded the newly modified document in
https://files.fakturama.info/rhefiles/Testdok-modified-002.pdf.

Regards,
Ralf.


Am 31.05.2020 um 21:56 schrieb Tilman Hausherr:
> Hi,
>
> In your  "after" file the existing metadata is lost. From what I see,
> the example creates metadata from scratch instead of changing the
> existing one.
>
> What might work is something like
>
> PDMetadata meta = catalog.getMetadata();
> DomXmpParser xmpParser = new DomXmpParser();
> XMPMetadata metadata = xmpParser.parse(meta.createInputStream());
>
> (I took this from the ExtractMetadata example)
>
> then use this "metadata" object. Please try that and tell whether that
> works. If not, please do again share the "after" file.
>
> Please do also give feedback if this works. I'm thinking of adding a
> comment in the example.
>
> Tilman
>
> Am 31.05.2020 um 21:31 schrieb Ralf Heydenreich:
>> Hi,
>> the before file can be found here:
>> https://files.fakturama.info/rhefiles/Testdok.pdf
>> the modified file is this:
>> https://files.fakturama.info/rhefiles/Testdok-modified.pdf
>>
>> Cheers,
>> Ralf.
>>
>> Am 31.05.2020 um 21:27 schrieb Tilman Hausherr:
>>> Please share the "before" and the "after" PDF, upload them to a
>>> sharehoster.
>>>
>>> Tilman
>>>
>>> Am 31.05.2020 um 21:22 schrieb Ralf Heydenreich:
>>>> Hi all,
>>>>
>>>> I've just checked the AddMetadataFromDocInfo example from pdfbox
>>>> repository (see
>>>> https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddMetadataFromDocInfo.java?revision=1792647&view=markup).
>>>>
>>>>
>>>> I've created a PDF/A-3 document with LibreOffice. Then I've used that
>>>> PDF as input for the example program. The resulting document contains
>>>> the changed metadata, but it's not a PDF/A-3 anymore. What can I do to
>>>> leave the document as PDF/A-3?
>>>>
>>>> Thanks in advance,
>>>> Ralf. 


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

Reply via email to