Index: site/user/sample/pdf.md |
diff --git a/site/user/sample/pdf.md b/site/user/sample/pdf.md |
index efadd5b42a7d219479c3249b0ee779af3e3d72fc..0a2aa4d471f16f88c1cd8a801551d64a9588f0f7 100644 |
--- a/site/user/sample/pdf.md |
+++ b/site/user/sample/pdf.md |
@@ -9,7 +9,7 @@ via the SkDocument and SkCanvas APIs. |
#include "SkDocument.h" |
bool WritePDF() { |
- SkWStream* output = ....; |
+ SkWStream* outputStream = ....; |
SkAutoTUnref<SkDocument> pdfDocument( |
SkDocument::CreatePDF(outputStream)); |
@@ -25,5 +25,16 @@ via the SkDocument and SkCanvas APIs. |
pdfDocument->endPage(); |
} |
+ |
+ SkTArray<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); |
+ pdfDocument->setMetadata(info, &now, &now); |
+ |
return pdfDocument->close(); |
} |