pdfkit/lib/metadata.js
Andrei Augustin ba4e7cb698
Fixed lint's unnecessary semicolon error (#1414)
* 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.
2023-03-05 15:25:01 -03:00

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;