-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix/xmp description subject #832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…and subject for subject instead of keywords
|
please add the hacktoberfest tag |
| $xmp .= "\t\t\t".'<dc:subject>'."\n"; | ||
| $xmp .= "\t\t\t\t".'<rdf:Bag>'."\n"; | ||
| $xmp .= "\t\t\t\t\t".'<rdf:li>'.TCPDF_STATIC::_escapeXML($this->keywords).'</rdf:li>'."\n"; | ||
| $xmp .= "\t\t\t\t\t".'<rdf:li>'.TCPDF_STATIC::_escapeXML($this->subject).'</rdf:li>'."\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this not break some users workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be, but putting "keywords" in a "subject" field seems wrong to me
@nicolaasuni comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the explanation, I will review this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that in a PDF file's metadata, the "subject" field and the Dublin Core (dc) element "dc:description" are distinct but related properties that describe the document's content.
- The "subject" property is part of the legacy "Document Information Dictionary" in a PDF file.
- The "dc:description" element is part of the Extensible Metadata Platform (XMP) metadata stream, which is the modern, standardized way to store metadata in Adobe products and PDF/A compliant files.
While distinct in name and original location, these fields are often synchronized. Indeed in TCPDF the "dc:description" value is set to the "subject" field value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In similar ways, "dc:subject" and "keywords" both serve to categorise a PDF document using specific topics or terms. They are essentially two different references for the same information within a modern PDF file.
| $xmp .= "\t\t\t".'</dc:description>'."\n"; | ||
| $xmp .= "\t\t\t".'<dc:subject>'."\n"; | ||
| $xmp .= "\t\t\t\t".'<rdf:Bag>'."\n"; | ||
| $xmp .= "\t\t\t\t\t".'<rdf:li>'.TCPDF_STATIC::_escapeXML($this->keywords).'</rdf:li>'."\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about this change. Why keywords was removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keywords haven't been removed. They are still where they should be; a few more lines after this one, you will find.
$xmp .= "\t\t\t".'<pdf:Keywords>'.TCPDF_STATIC::_escapeXML($this->keywords).'</pdf:Keywords>'."\n";
What I am doing is using subject inside the <dc:subject> section instead of keywords
PR for issue #817
The code that generates that is
We can see here that
With this PR the code to create the PDF is now
and the output is
where you can see that we have description and subject as per the methods.