diff options
author | 2011-07-18 23:13:19 +0000 | |
---|---|---|
committer | 2011-07-18 23:13:19 +0000 | |
commit | fb6a53a406636a81094be8b75180fddcc02ff957 (patch) | |
tree | 5b3bab9475dbbcf647b0788cb24d147a320da50f /include/pdf/SkPDFDocument.h | |
parent | 4a947d264b2764685e5f82b2e5d328a50e9612ea (diff) |
[PDF] Add setPage method to SkPDFDocument.
BUG=312
Review URL: http://codereview.appspot.com/4763047
git-svn-id: http://skia.googlecode.com/svn/trunk@1892 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/pdf/SkPDFDocument.h')
-rw-r--r-- | include/pdf/SkPDFDocument.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/pdf/SkPDFDocument.h b/include/pdf/SkPDFDocument.h index 0a76ea26aa..5fb7c95405 100644 --- a/include/pdf/SkPDFDocument.h +++ b/include/pdf/SkPDFDocument.h @@ -37,11 +37,24 @@ public: SK_API SkPDFDocument(); SK_API ~SkPDFDocument(); - /** Output the PDF to the passed stream. + /** Output the PDF to the passed stream. It is an error to call this (it + * will return false and not modify stream) if no pages have been added + * or there are pages missing (i.e. page 1 and 3 have been added, but not + * page 2). + * * @param stream The writable output stream to send the PDF to. */ SK_API bool emitPDF(SkWStream* stream); + /** Sets the specific page to the passed PDF device. If the specified + * page is already set, this overrides it. Returns true if successful. + * Will fail if the document has already been emitted. + * + * @param pageNumber The position to add the passed device (1 based). + * @param pdfDevice The page to add to this document. + */ + SK_API bool setPage(int pageNumber, const SkRefPtr<SkPDFDevice>& pdfDevice); + /** Append the passed pdf device to the document as a new page. Returns * true if successful. Will fail if the document has already been emitted. * |