mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
* Fixed lint's unnecessary semicolon error * Fixed pdfa1 colour profile test error The directory where the colour profile is stored was changed, but the test was not updated.
35 lines
841 B
JavaScript
35 lines
841 B
JavaScript
|
|
class PDFMetadata {
|
|
constructor() {
|
|
this._metadata = `
|
|
<?xpacket begin="\ufeff" id="W5M0MpCehiHzreSzNTczkc9d"?>
|
|
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
|
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
|
`;
|
|
}
|
|
|
|
_closeTags() {
|
|
this._metadata = this._metadata.concat(`
|
|
</rdf:RDF>
|
|
</x:xmpmeta>
|
|
<?xpacket end="w"?>
|
|
`);
|
|
}
|
|
|
|
append(xml, newline=true) {
|
|
this._metadata = this._metadata.concat(xml);
|
|
if (newline)
|
|
this._metadata = this._metadata.concat('\n');
|
|
}
|
|
|
|
getXML() { return this._metadata; }
|
|
|
|
getLength() { return this._metadata.length; }
|
|
|
|
end() {
|
|
this._closeTags();
|
|
this._metadata = this._metadata.trim();
|
|
}
|
|
}
|
|
|
|
export default PDFMetadata; |