[PDF] Add pages accessor to SkPDFDocument.
authorvandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 31 May 2011 18:18:21 +0000 (18:18 +0000)
committervandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 31 May 2011 18:18:21 +0000 (18:18 +0000)
Also add SK_API to SkPDFPage::getFontResources.

Review URL: http://codereview.appspot.com/4561050

git-svn-id: http://skia.googlecode.com/svn/trunk@1453 2bbb7eff-a529-9590-31e7-b0007b416f81

include/pdf/SkPDFDocument.h
include/pdf/SkPDFPage.h
src/pdf/SkPDFDocument.cpp

index 0bc9a3c573afd1968c1455926ef247bacf8871b5..0a76ea26aa10efc213fa81e5afc39beb5f4c2187 100644 (file)
@@ -49,6 +49,10 @@ public:
      */
     SK_API bool appendPage(const SkRefPtr<SkPDFDevice>& pdfDevice);
 
+    /** Get the list of pages in this document.
+     */
+    SK_API const SkTDArray<SkPDFPage*>& getPages();
+
 private:
     SkPDFCatalog fCatalog;
     int64_t fXRefFileOffset;
index d677a29182cff9aed645acc261bdc49f9059f754..0e30028ae72af5983c9dc26b5737831e63f02d13 100644 (file)
@@ -88,7 +88,7 @@ public:
 
     /** Get the fonts used on this page.
      */
-    const SkTDArray<SkPDFFont*>& getFontResources() const;
+    SK_API const SkTDArray<SkPDFFont*>& getFontResources() const;
 
 private:
     // Multiple pages may reference the content.
index 79ce9f3f79092a72508dc690c08c9dd2ce8d04a3..95370b4642da7112153d2375002a1a191cb7678c 100644 (file)
@@ -154,6 +154,10 @@ bool SkPDFDocument::appendPage(const SkRefPtr<SkPDFDevice>& pdfDevice) {
     return true;
 }
 
+const SkTDArray<SkPDFPage*>& SkPDFDocument::getPages() {
+    return fPages;
+}
+
 void SkPDFDocument::emitHeader(SkWStream* stream) {
     stream->writeText("%PDF-1.4\n%");
     // The PDF spec recommends including a comment with four bytes, all