Skia
2DGraphicsLibrary
|
Set the document's metadata, if supported by the document type. More...
#include <SkDocument.h>
Public Member Functions | |
Attribute (const SkString &k, const SkString &v) | |
Public Attributes | |
SkString | fKey |
SkString | fValue |
Set the document's metadata, if supported by the document type.
The creationDate and modifiedDate parameters can be nullptr. For example:
SkDocument* make_doc(SkWStream* output) { std::vector<SkDocument::Attribute> info; info.emplace_back(SkString("Title"), SkString("...")); info.emplace_back(SkString("Author"), SkString("...")); info.emplace_back(SkString("Subject"), SkString("...")); info.emplace_back(SkString("Keywords"), SkString("...")); info.emplace_back(SkString("Creator"), SkString("...")); SkTime::DateTime now; SkTime::GetDateTime(&now); SkDocument* doc = SkDocument::CreatePDF(output); doc->setMetadata(&info[0], (int)info.size(), &now, &now); return doc; }