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.
Would this not break some users workflow?
There was a problem hiding this comment.
could be, but putting "keywords" in a "subject" field seems wrong to me
@nicolaasuni comments?
There was a problem hiding this comment.
thanks for the explanation, I will review this.
There was a problem hiding this comment.
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.
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.
not sure about this change. Why keywords was removed?
There was a problem hiding this comment.
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.