WeasyPrint
WeasyPrint copied to clipboard
Duplicate Author Metatags with PDF/A
I have a document, where I list multiple authors in the meta tags:
<meta name="author" content="Ben Tester" />
<meta name="author" content="Max Muster" />
In the default configuration, they are added as a single string (/Author (Ben Tester, Max Muster)
in the pdf):
If I activate PDF/A with --pdf-variant=pdf/a-2b
, I get the previous string as well as the first author (<dc:creator><rdf:Seq><rdf:li>Ben Tester</rdf:li><rdf:li>Max Muster</rdf:li></rdf:Seq></dc:creator>
in the pdf):
In the end this is probably more an issue of Adobe Reader than of weasyprint, but it still looks award.
Without knowing, if this leads to other issues: Not setting /Author (Ben Tester, Max Muster)
if <dc:creator>
is set, solves the problem:
Hi!
Thanks for the bug report.
In the end this is probably more an issue of Adobe Reader than of weasyprint, but it still looks award.
You’re right, that’s probably a bug in Adobe Reader.
As the /Author
tag only accepts a string, we create a string with a comma between the different authors. The dc:creator
field accepts a list, that’s why we can put separate fields in it.
If you can find a way to avoid this bug (by using something else than a comma for example) we may include a fix. Otherwise, you should probably report this bug to Adobe 😁.
After playing around, I think I understand the behaviour of Adobe Reader:
If both /Author
and <dc:creator>
are defined, it shows
-
/Author
-
<dc:creator>[1:]
.
This is independent of the content of <dc:creator>[0]
.
So, the solution to be compatible with Adobe Reader it would be to write only the first author to /Author
.
This brings me to another observation:
In the HTML I used the order Ben Tester, Max Muster
, however in the PDF it is the other way around: Ben Tester, Max Muster
.
So, the solution to be compatible with Adobe Reader it would be to write only the first author to
/Author
.
I prefer to keep the current behavior, it’s probably better to see all the authors in basic PDF documents even if it means that the field is broken when generating PDF/A documents with multiple authors.
In the HTML I used the order
Ben Tester, Max Muster
, however in the PDF it is the other way around:Ben Tester, Max Muster
.
I can’t reproduce this "problem". Do you have a sample that reliably gives this result?
Please add a comment if there’s anything more we can do about this topic.