Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Unified Diff: site/user/sample/pdf.md

Issue 849133002: convert pdf design document to markdown (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Another Patch Set Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « site/dev/design/pdftheory.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: site/user/sample/pdf.md
diff --git a/site/user/sample/pdf.md b/site/user/sample/pdf.md
new file mode 100644
index 0000000000000000000000000000000000000000..efadd5b42a7d219479c3249b0ee779af3e3d72fc
--- /dev/null
+++ b/site/user/sample/pdf.md
@@ -0,0 +1,29 @@
+Using Skia's PDF Backend
+========================
+
+Here is an example of using Skia's PDF backend in the recommended way:
+via the SkDocument and SkCanvas APIs.
+
+<!--?prettify?-->
+
+ #include "SkDocument.h"
+
+ bool WritePDF() {
+ SkWStream* output = ....;
+
+ SkAutoTUnref<SkDocument> pdfDocument(
+ SkDocument::CreatePDF(outputStream));
+
+ int numberOfPages = ....;
+ for (int page = 0; page < numberOfPages; ++page) {
+ SkScalar pageWidth = ....;
+ SkScalar pageHeight = ....;
+ SkCanvas* pageCanvas =
+ pdfDocument->beginPage(pageWidth, pageHeight);
+
+ // ....insert canvas draw commands here....
+
+ pdfDocument->endPage();
+ }
+ return pdfDocument->close();
+ }
« no previous file with comments | « site/dev/design/pdftheory.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698