From fb6a53a406636a81094be8b75180fddcc02ff957 Mon Sep 17 00:00:00 2001 From: "vandebo@chromium.org" Date: Mon, 18 Jul 2011 23:13:19 +0000 Subject: [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 --- include/pdf/SkPDFDocument.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include/pdf/SkPDFDocument.h') 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& 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. * -- cgit v1.2.3