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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « site/dev/design/pdftheory.md ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 Using Skia's PDF Backend
2 ========================
3
4 Here is an example of using Skia's PDF backend in the recommended way:
5 via the SkDocument and SkCanvas APIs.
6
7 <!--?prettify?-->
8
9 #include "SkDocument.h"
10
11 bool WritePDF() {
12 SkWStream* output = ....;
13
14 SkAutoTUnref<SkDocument> pdfDocument(
15 SkDocument::CreatePDF(outputStream));
16
17 int numberOfPages = ....;
18 for (int page = 0; page < numberOfPages; ++page) {
19 SkScalar pageWidth = ....;
20 SkScalar pageHeight = ....;
21 SkCanvas* pageCanvas =
22 pdfDocument->beginPage(pageWidth, pageHeight);
23
24 // ....insert canvas draw commands here....
25
26 pdfDocument->endPage();
27 }
28 return pdfDocument->close();
29 }
OLDNEW
« 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