Basic support for Type3 Fonts in Pdf + various refactorings

Review URL: https://codereview.chromium.org/17748002

git-svn-id: http://skia.googlecode.com/svn/trunk@9757 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/PdfViewer/SkPdfBasics.cpp b/experimental/PdfViewer/SkPdfBasics.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/experimental/PdfViewer/SkPdfBasics.cpp
diff --git a/experimental/PdfViewer/SkPdfBasics.h b/experimental/PdfViewer/SkPdfBasics.h
new file mode 100644
index 0000000..126e63d
--- /dev/null
+++ b/experimental/PdfViewer/SkPdfBasics.h
@@ -0,0 +1,136 @@
+#ifndef __DEFINED__SkPdfBasics
+#define __DEFINED__SkPdfBasics
+
+#include "podofo.h"
+using namespace PoDoFo;
+
+#include <iostream>
+#include <cstdio>
+#include <stack>
+
+//#define PDF_TRACE
+//#define PDF_TRACE_DIFF_IN_PNG
+//#define PDF_DEBUG_NO_CLIPING
+//#define PDF_DEBUG_NO_PAGE_CLIPING
+//#define PDF_DEBUG_3X
+
+class SkPdfFont;
+class SkPdfDoc;
+
+// TODO(edisonn): better class design.
+struct PdfColorOperator {
+    std::string fColorSpace;  // TODO(edisonn): use SkString
+    SkColor fColor;
+    double fOpacity;  // ca or CA
+    // TODO(edisonn): add here other color space options.
+
+    void setRGBColor(SkColor color) {
+        // TODO(edisonn): ASSERT DeviceRGB is the color space.
+        fColor = color;
+    }
+    // TODO(edisonn): double check the default values for all fields.
+    PdfColorOperator() : fColor(SK_ColorBLACK), fOpacity(1) {}
+
+    void applyGraphicsState(SkPaint* paint) {
+        paint->setColor(SkColorSetA(fColor, fOpacity * 255));
+    }
+};
+
+// TODO(edisonn): better class design.
+struct PdfGraphicsState {
+    SkMatrix            fMatrix;
+    SkMatrix            fMatrixTm;
+    SkMatrix            fMatrixTlm;
+
+    double              fCurPosX;
+    double              fCurPosY;
+
+    double              fCurFontSize;
+    bool                fTextBlock;
+    SkPdfFont*          fSkFont;
+    SkPath              fPath;
+    bool                fPathClosed;
+
+    // Clip that is applied after the drawing is done!!!
+    bool                fHasClipPathToApply;
+    SkPath              fClipPath;
+
+    PdfColorOperator    fStroking;
+    PdfColorOperator    fNonStroking;
+
+    double              fLineWidth;
+    double              fTextLeading;
+    double              fWordSpace;
+    double              fCharSpace;
+
+    SkPdfResourceDictionary* fResources;
+
+    SkBitmap            fSMask;
+
+    PdfGraphicsState() {
+        fCurPosX      = 0.0;
+        fCurPosY      = 0.0;
+        fCurFontSize  = 0.0;
+        fTextBlock    = false;
+        fMatrix       = SkMatrix::I();
+        fMatrixTm     = SkMatrix::I();
+        fMatrixTlm    = SkMatrix::I();
+        fPathClosed   = true;
+        fLineWidth    = 0;
+        fTextLeading  = 0;
+        fWordSpace    = 0;
+        fCharSpace    = 0;
+        fHasClipPathToApply = false;
+        fResources    = NULL;
+        fSkFont       = NULL;
+    }
+
+    void applyGraphicsState(SkPaint* paint, bool stroking) {
+        if (stroking) {
+            fStroking.applyGraphicsState(paint);
+        } else {
+            fNonStroking.applyGraphicsState(paint);
+        }
+
+        // TODO(edisonn): get this from pdfContext->options,
+        // or pdfContext->addPaintOptions(&paint);
+        paint->setAntiAlias(true);
+
+        // TODO(edisonn): dashing, miter, ...
+        paint->setStrokeWidth(SkDoubleToScalar(fLineWidth));
+    }
+};
+
+// TODO(edisonn): better class design.
+struct PdfInlineImage {
+    std::map<std::string, std::string> fKeyValuePairs;
+    std::string fImageData;
+};
+
+// TODO(edisonn): better class design.
+struct PdfContext {
+    std::stack<SkPdfObject*>        fObjectStack;
+    std::stack<PdfGraphicsState>    fStateStack;
+    PdfGraphicsState                fGraphicsState;
+    SkPdfDoc*                       fPdfDoc;
+    SkMatrix                        fOriginalMatrix;
+
+    PdfInlineImage                  fInlineImage;
+
+    PdfContext(SkPdfDoc* doc) :  fPdfDoc(doc) {}
+
+};
+
+//  TODO(edisonn): temporary code, to report how much of the PDF we actually think we rendered.
+enum PdfResult {
+    kOK_PdfResult,
+    kPartial_PdfResult,
+    kNYI_PdfResult,
+    kIgnoreError_PdfResult,
+    kError_PdfResult,
+    kUnsupported_PdfResult,
+
+    kCount_PdfResult
+};
+
+#endif  // __DEFINED__SkPdfBasics
diff --git a/experimental/PdfViewer/SkPdfFont.cpp b/experimental/PdfViewer/SkPdfFont.cpp
index 520c820..a4d70ab 100644
--- a/experimental/PdfViewer/SkPdfFont.cpp
+++ b/experimental/PdfViewer/SkPdfFont.cpp
@@ -70,6 +70,7 @@
         // see FT_Get_Postscript_Name
         // Font config is not using it, yet.
         //https://bugs.freedesktop.org/show_bug.cgi?id=18095
+
         gPdfStandardFonts["Arial-Black"] = {"Arial", true, false};
         gPdfStandardFonts["DejaVuSans"] = {"DejaVu Sans", false, false};
         gPdfStandardFonts["DejaVuSansMono"] = {"DejaVuSans Mono", false, false};
@@ -82,6 +83,34 @@
         gPdfStandardFonts["TrebuchetMS-Bold"] = {"Trebuchet MS", true, false};
         gPdfStandardFonts["Verdana-Bold"] = {"Verdana", true, false};
         gPdfStandardFonts["WenQuanYiMicroHei"] = {"WenQuanYi Micro Hei", false, false};
+
+        // TODO(edisonn): list all phonts available, builf post script name as in pdf spec
+        /*
+         * The PostScript name for the value of BaseFontis determined in one of two ways:
+• Use the PostScript name that is an optional entry in the “name” table of the
+TrueType font itself.
+• In the absence of such an entry in the “name” table, derive a PostScript name
+from the name by which the font is known in the host operating system: on a
+Windows system, it is based on the lfFaceName field in a LOGFONT structure; in
+the Mac OS, it is based on the name of the FONDresource. If the name contains
+any spaces, the spaces are removed.
+If the font in a source document uses a bold or italic style, but there is no font
+data for that style, the host operating system will synthesize the style. In this case,
+a comma and the style name (one of Bold, Italic, or BoldItalic) are appended to the
+font name. For example, for a TrueType font that is a bold variant of the New
+         */
+
+        /*
+         * If the value of Subtype is MMType1.
+• If the PostScript name of the instance contains spaces, the spaces are replaced
+by underscores in the value of BaseFont. For instance, as illustrated in Example
+5.7, the name “MinionMM 366 465 11 ” (which ends with a space character)
+becomes /MinionMM_366_465_11_.
+         */
+
+        // might not work on all oses ?
+        //
+
     }
 
     return gPdfStandardFonts;
@@ -178,6 +207,8 @@
         return NULL;  // default one?
     }
 
+
+
     return new SkPdfType3Font(dict);
 }
 
@@ -213,26 +244,11 @@
     return ret;
 }
 
-SkPdfType0Font::SkPdfType0Font(SkPdfType0FontDictionary* dict) {
-    fBaseFont = SkPdfFontFromName(dict, dict->BaseFont().c_str());
-
-    // TODO(edisonn): load encoding, let it now to be Identity-H by default
-    if (dict->has_Encoding()) {
-        if (dict->isEncodingAName()) {
-            //report encoding not supported
-            //fEncoding = loadEncodingFromName(dict->getEncodingAsName().c_str());
-        } else if (dict->isEncodingAStream()) {
-            //fEncoding = loadEncodingFromStream(dict->getEncodingAsStream());
-        } else {
-            // error
-        }
-    }
-
+SkPdfToUnicode::SkPdfToUnicode(const SkPdfStream* stream) {
     fCMapEncoding = NULL;
     fCMapEncodingFlag = NULL;
 
-    if (dict->has_ToUnicode()) {
-        const SkPdfStream* stream = dict->ToUnicode();
+    if (stream) {
         SkPdfTokenizer tokenizer(stream);
         PdfToken token;
 
@@ -318,3 +334,44 @@
         }
     }
 }
+
+
+SkPdfType0Font::SkPdfType0Font(SkPdfType0FontDictionary* dict) {
+    fBaseFont = SkPdfFontFromName(dict, dict->BaseFont().c_str());
+    fEncoding = NULL;
+
+    if (dict->has_Encoding()) {
+        if (dict->isEncodingAName()) {
+            fEncoding = SkPdfEncoding::fromName(dict->getEncodingAsName().c_str());
+        } else if (dict->isEncodingAStream()) {
+            //fEncoding = loadEncodingFromStream(dict->getEncodingAsStream());
+        } else {
+            // TODO(edisonn): error ... warning .. assert?
+        }
+    }
+
+    if (dict->has_ToUnicode()) {
+        fToUnicode = new SkPdfToUnicode(dict->ToUnicode());
+    }
+}
+
+std::map<std::string, SkPdfEncoding*>& getStandardEncodings() {
+    static std::map<std::string, SkPdfEncoding*> encodings;
+    if (encodings.empty()) {
+        encodings["Identity-H"] = SkPdfIdentityHEncoding::instance();
+    }
+
+    return encodings;
+}
+
+
+SkPdfEncoding* SkPdfEncoding::fromName(const char* name) {
+    SkPdfEncoding* encoding = getStandardEncodings()[name];
+
+#ifdef PDF_TRACE
+    if (encoding == NULL) {
+        printf("Encoding not found: %s\n", name);
+    }
+#endif
+    return encoding;
+}
diff --git a/experimental/PdfViewer/SkPdfFont.h b/experimental/PdfViewer/SkPdfFont.h
index 2ba6e7a..a3f0d36 100644
--- a/experimental/PdfViewer/SkPdfFont.h
+++ b/experimental/PdfViewer/SkPdfFont.h
@@ -8,6 +8,9 @@
 #include <string>
 
 #include "SkUtils.h"
+#include "SkPdfBasics.h"
+#include "SkPdfUtils.h"
+
 
 class SkPdfType0Font;
 class SkPdfType1Font;
@@ -42,6 +45,9 @@
 struct SkDecodedText {
     uint16_t* text;
     int len;
+public:
+    unsigned int operator[](int i) const { return text[i]; }
+    int size() const { return len; }
 };
 
 struct SkUnicodeText {
@@ -56,8 +62,21 @@
 class SkPdfEncoding {
 public:
     virtual bool decodeText(const SkUnencodedText& textIn, SkDecodedText* textOut) const = 0;
+    static SkPdfEncoding* fromName(const char* name);
 };
 
+std::map<std::string, SkPdfEncoding*>& getStandardEncodings();
+
+class SkPdfToUnicode {
+    // TODO(edisonn): hide public members
+public:
+    unsigned short* fCMapEncoding;
+    unsigned char* fCMapEncodingFlag;
+
+    SkPdfToUnicode(const SkPdfStream* stream);
+};
+
+
 class SkPdfIdentityHEncoding : public SkPdfEncoding {
 public:
     virtual bool decodeText(const SkUnencodedText& textIn, SkDecodedText* textOut) const {
@@ -80,25 +99,66 @@
     }
 };
 
+
+class SkPdfCIDToGIDMapIdentityEncoding : public SkPdfEncoding {
+public:
+    virtual bool decodeText(const SkUnencodedText& textIn, SkDecodedText* textOut) const {
+        // TODO(edisonn): SkASSERT(textIn.len % 2 == 0); or report error?
+
+        unsigned char* text = (unsigned char*)textIn.text;
+        textOut->text = new uint16_t[textIn.len];
+        textOut->len = textIn.len;
+
+        for (int i = 0; i < textOut->len; i++) {
+            textOut->text[i] = text[i];
+        }
+
+        return true;
+    }
+
+    static SkPdfCIDToGIDMapIdentityEncoding* instance() {
+        static SkPdfCIDToGIDMapIdentityEncoding* inst = new SkPdfCIDToGIDMapIdentityEncoding();
+        return inst;
+    }
+};
+
 class SkPdfFont {
 public:
     SkPdfFont* fBaseFont;
     SkPdfEncoding* fEncoding;
+    SkPdfToUnicode* fToUnicode;
+
 
 public:
-    SkPdfFont() : fBaseFont(NULL), fEncoding(SkPdfIdentityHEncoding::instance()) {}
+    SkPdfFont() : fBaseFont(NULL), fEncoding(NULL), fToUnicode(NULL) {}
 
     const SkPdfEncoding* encoding() const {return fEncoding;}
 
-    void drawText(const SkUnicodeText& text, SkPaint* paint, SkCanvas* canvas, SkMatrix* matrix) {
+    void drawText(const SkDecodedText& text, SkPaint* paint, PdfContext* pdfContext, SkCanvas* canvas, SkMatrix* matrix) {
         for (int i = 0 ; i < text.size(); i++) {
-            drawOneChar(text[i], paint, canvas, matrix);
+            drawOneChar(text[i], paint, pdfContext, canvas, matrix);
         }
     }
 
-    virtual void ToUnicode(const SkDecodedText& textIn, SkUnicodeText* textOut) const {
-        textOut->text = textIn.text;
-        textOut->len = textIn.len;
+    void ToUnicode(const SkDecodedText& textIn, SkUnicodeText* textOut) const {
+        if (fToUnicode) {
+            textOut->text = new uint16_t[textIn.len];
+            textOut->len = textIn.len;
+            for (int i = 0; i < textIn.len; i++) {
+                textOut->text[i] = fToUnicode->fCMapEncoding[textIn.text[i]];
+            }
+        } else {
+            textOut->text = textIn.text;
+            textOut->len = textIn.len;
+        }
+    };
+
+    inline unsigned int ToUnicode(unsigned int ch) const {
+        if (fToUnicode) {
+            return fToUnicode->fCMapEncoding[ch];
+        } else {
+            return ch;
+        }
     };
 
     static SkPdfFont* fontFromPdfDictionary(SkPdfFontDictionary* dict);
@@ -112,7 +172,7 @@
     static SkPdfMultiMasterFont* fontFromMultiMasterFontDictionary(SkPdfMultiMasterFontDictionary* dict);
 
 public:
-    virtual void drawOneChar(unsigned int ch, SkPaint* paint, SkCanvas* canvas, SkMatrix* matrix) = 0;
+    virtual void drawOneChar(unsigned int ch, SkPaint* paint, PdfContext* pdfContext, SkCanvas* canvas, SkMatrix* matrix) = 0;
     virtual void afterChar(SkPaint* paint, SkMatrix* matrix) = 0;
     virtual void afterWord(SkPaint* paint, SkMatrix* matrix) = 0;
 };
@@ -124,7 +184,7 @@
     SkPdfStandardFont(SkTypeface* typeface) : fTypeface(typeface) {}
 
 public:
-    virtual void drawOneChar(unsigned int ch, SkPaint* paint, SkCanvas* canvas, SkMatrix* matrix) {
+    virtual void drawOneChar(unsigned int ch, SkPaint* paint, PdfContext* pdfContext, SkCanvas* canvas, SkMatrix* matrix) {
         paint->setTypeface(fTypeface);
         paint->setTextEncoding(SkPaint::kUTF8_TextEncoding);
 
@@ -142,24 +202,14 @@
     virtual void afterWord(SkPaint* paint, SkMatrix* matrix) {}
 };
 
-
 class SkPdfType0Font : public SkPdfFont {
-    unsigned short* fCMapEncoding;
-    unsigned char* fCMapEncodingFlag;
 public:
     SkPdfType0Font(SkPdfType0FontDictionary* dict);
 
 public:
-    virtual void ToUnicode(const SkDecodedText& textIn, SkUnicodeText* textOut) const {
-        textOut->text = new uint16_t[textIn.len];
-        textOut->len = textIn.len;
-        for (int i = 0; i < textIn.len; i++) {
-            textOut->text[i] = fCMapEncoding[textIn.text[i]];
-        }
-    };
 
-    virtual void drawOneChar(unsigned int ch, SkPaint* paint, SkCanvas* canvas, SkMatrix* matrix) {
-        fBaseFont->drawOneChar(ch, paint, canvas, matrix);
+    virtual void drawOneChar(unsigned int ch, SkPaint* paint, PdfContext* pdfContext, SkCanvas* canvas, SkMatrix* matrix) {
+        fBaseFont->drawOneChar(ToUnicode(ch), paint, pdfContext, canvas, matrix);
     }
 
     virtual void afterChar(SkPaint* paint, SkMatrix* matrix) {
@@ -167,7 +217,6 @@
     }
 
     virtual void afterWord(SkPaint* paint, SkMatrix* matrix) {
-
     }
 };
 
@@ -178,7 +227,7 @@
     }
 
 public:
-    virtual void drawOneChar(unsigned int ch, SkPaint* paint, SkCanvas* canvas, SkMatrix* matrix) {
+    virtual void drawOneChar(unsigned int ch, SkPaint* paint, PdfContext* pdfContext, SkCanvas* canvas, SkMatrix* matrix) {
 
     }
 
@@ -200,7 +249,7 @@
 
 
 public:
-      virtual void drawOneChar(unsigned int ch, SkPaint* paint, SkCanvas* canvas, SkMatrix* matrix) {
+      virtual void drawOneChar(unsigned int ch, SkPaint* paint, PdfContext* pdfContext, SkCanvas* canvas, SkMatrix* matrix) {
 
       }
 
@@ -221,7 +270,7 @@
     }
 
 public:
-    virtual void drawOneChar(unsigned int ch, SkPaint* paint, SkCanvas* canvas, SkMatrix* matrix) {
+    virtual void drawOneChar(unsigned int ch, SkPaint* paint, PdfContext* pdfContext, SkCanvas* canvas, SkMatrix* matrix) {
 
     }
 
@@ -241,7 +290,7 @@
     }
 
 public:
-    virtual void drawOneChar(unsigned int ch, SkPaint* paint, SkCanvas* canvas, SkMatrix* matrix) {
+    virtual void drawOneChar(unsigned int ch, SkPaint* paint, PdfContext* pdfContext, SkCanvas* canvas, SkMatrix* matrix) {
 
     }
 
@@ -253,20 +302,130 @@
 
     }
 };
+/*
+class CIDToGIDMap {
+    virtual unsigned int map(unsigned int cid) = 0;
+    static CIDToGIDMap* fromName(const char* name);
+};
+
+class CIDToGIDMap_Identity {
+    virtual unsigned int map(unsigned int cid) { return cid; }
+
+    static CIDToGIDMap_Identity* instance() {
+        static CIDToGIDMap_Identity* inst = new CIDToGIDMap_Identity();
+        return inst;
+    }
+};
+
+CIDToGIDMap* CIDToGIDMap::fromName(const char* name) {
+    // The only one supported right now is Identity
+    if (strcmp(name, "Identity") == 0) {
+        return CIDToGIDMap_Identity::instance();
+    }
+
+#ifdef PDF_TRACE
+    // TODO(edisonn): warning/report
+    printf("Unknown CIDToGIDMap: %s\n", name);
+#endif
+    return NULL;
+}
+CIDToGIDMap* fCidToGid;
+*/
 
 class SkPdfType3Font : public SkPdfFont {
+    struct Type3FontChar {
+        SkPdfObject* fObj;
+        double fWidth;
+    };
+
+    SkPdfDictionary* fCharProcs;
+    SkPdfEncodingDictionary* fEncodingDict;
+    unsigned int fFirstChar;
+    unsigned int fLastChar;
+
+    SkRect fFontBBox;
+    SkMatrix fFonMatrix;
+
+    Type3FontChar* fChars;
+
 public:
     SkPdfType3Font(SkPdfType3FontDictionary* dict) {
         fBaseFont = SkPdfFontFromName(dict, dict->BaseFont().c_str());
+
+        if (dict->has_Encoding()) {
+            if (dict->isEncodingAName()) {
+                 fEncoding = SkPdfEncoding::fromName(dict->getEncodingAsName().c_str());
+            } else if (dict->isEncodingAEncodingdictionary()) {
+                 // technically, there is no encoding.
+                 fEncoding = SkPdfCIDToGIDMapIdentityEncoding::instance();
+                 fEncodingDict = dict->getEncodingAsEncodingdictionary();
+            }
+        }
+
+        // null?
+        fCharProcs = dict->CharProcs();
+
+        fToUnicode = NULL;
+        if (dict->has_ToUnicode()) {
+            fToUnicode = new SkPdfToUnicode(dict->ToUnicode());
+        }
+
+        fFirstChar = dict->FirstChar();
+        fLastChar = dict->LastChar();
+        fFonMatrix = dict->has_FontMatrix() ? *dict->FontMatrix() : SkMatrix::I();
+
+        if (dict->FontBBox()) {
+            fFontBBox = *dict->FontBBox();
+        }
+
+        fChars = new Type3FontChar[fLastChar - fFirstChar + 1];
+
+        memset(fChars, 0, sizeof(fChars[0]) * (fLastChar - fFirstChar + 1));
+
+
+        SkPdfArray* widths = dict->Widths();
+        for (int i = 0 ; i < widths->size(); i++) {
+            if ((fFirstChar + i) < fFirstChar || (fFirstChar + i) > fLastChar) {
+                printf("break; error 1\n");
+            }
+            fChars[i].fWidth = (*widths)[i]->asNumber()->value();
+        }
+
+        SkPdfArray* diffs = fEncodingDict->Differences();
+        int j = fFirstChar;
+        for (int i = 0 ; i < diffs->size(); i++) {
+            if ((*diffs)[i]->asInteger()) {
+                j = (*diffs)[i]->asInteger()->value();
+            } else if ((*diffs)[i]->asName()) {
+                if (j < fFirstChar || j > fLastChar) {
+                    printf("break; error 2\n");
+                }
+                fChars[j - fFirstChar].fObj = fCharProcs->get((*diffs)[i]->asName()->value().c_str());
+                j++;
+            } else {
+                // err
+            }
+        }
     }
 
 public:
-    virtual void drawOneChar(unsigned int ch, SkPaint* paint, SkCanvas* canvas, SkMatrix* matrix) {
+    virtual void drawOneChar(unsigned int ch, SkPaint* paint, PdfContext* pdfContext, SkCanvas* canvas, SkMatrix* matrix) {
+        if (ch < fFirstChar || ch > fLastChar || !fChars[ch - fFirstChar].fObj) {
+            fBaseFont->drawOneChar(ToUnicode(ch), paint, pdfContext, canvas, matrix);
+            return;
+        }
 
+#ifdef PDF_TRACE
+        printf("Type 3 char to unicode: %c\n", ToUnicode(ch));
+        if (ToUnicode(ch) == 'A') {
+            printf("break;\n");
+        }
+#endif
+
+        doType3Char(pdfContext, canvas, fChars[ch - fFirstChar].fObj, fFontBBox, fFonMatrix, pdfContext->fGraphicsState.fCurFontSize);
     }
 
     virtual void afterChar(SkPaint* paint, SkMatrix* matrix) {
-
     }
 
     virtual void afterWord(SkPaint* paint, SkMatrix* matrix) {
diff --git a/experimental/PdfViewer/SkPdfParser.h b/experimental/PdfViewer/SkPdfParser.h
new file mode 100644
index 0000000..7e2cd0e
--- /dev/null
+++ b/experimental/PdfViewer/SkPdfParser.h
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "podofo.h"
+#include "SkPdfHeaders_autogen.h"
+#include "SkPdfPodofoMapper_autogen.h"
+
+#ifndef SkPdfParser_DEFINED
+#define SkPdfParser_DEFINED
+
+
+enum SkPdfTokenType {
+    kKeyword_TokenType,
+    kObject_TokenType,
+    kImageData_TokenType,  // TODO(edisonn): inline images seem to work without it
+};
+
+struct PdfToken {
+    const char*      fKeyword;
+    SkPdfObject*     fObject;
+    SkPdfTokenType   fType;
+
+    PdfToken() : fKeyword(NULL), fObject(NULL) {}
+};
+
+class SkPdfTokenizer {
+    PdfContentsTokenizer* fTokenizer;
+    PdfMemDocument* fDoc;
+
+    char* fUncompressedStream;
+    pdf_long fUncompressedStreamLength;
+
+    bool fEmpty;
+    bool fHasPutBack;
+    PdfToken fPutBack;
+
+public:
+    SkPdfTokenizer(PdfMemDocument* doc = NULL, PdfContentsTokenizer* tokenizer = NULL) : fDoc(doc), fTokenizer(tokenizer), fEmpty(false), fUncompressedStream(NULL), fUncompressedStreamLength(0), fHasPutBack(false) {}
+    SkPdfTokenizer(const SkPdfObject* objWithStream) : fDoc(NULL), fTokenizer(NULL), fHasPutBack(false), fEmpty(false) {
+        fUncompressedStream = NULL;
+        fUncompressedStreamLength = 0;
+
+        fDoc = NULL;
+
+
+        try {
+            objWithStream->podofo()->GetStream()->GetFilteredCopy(&fUncompressedStream, &fUncompressedStreamLength);
+            if (fUncompressedStream != NULL && fUncompressedStreamLength != 0) {
+                fTokenizer = new PdfContentsTokenizer(fUncompressedStream, fUncompressedStreamLength);
+            } else {
+                fEmpty = true;
+            }
+        } catch (PdfError& e) {
+            fEmpty = true;
+        }
+
+    }
+
+    SkPdfTokenizer(const char* buffer, int len) : fDoc(NULL), fTokenizer(NULL), fHasPutBack(false), fUncompressedStream(NULL), fUncompressedStreamLength(0), fEmpty(false) {
+        try {
+            fTokenizer = new PdfContentsTokenizer(buffer, len);
+        } catch (PdfError& e) {
+            fEmpty = true;
+        }
+    }
+
+    ~SkPdfTokenizer() {
+        free(fUncompressedStream);
+    }
+
+    void PutBack(PdfToken token) {
+        SkASSERT(!fHasPutBack);
+        fHasPutBack = true;
+        fPutBack = token;
+    }
+
+    bool readToken(PdfToken* token) {
+        if (fHasPutBack) {
+            *token = fPutBack;
+            fHasPutBack = false;
+            return true;
+        }
+
+        if (fEmpty) {
+            return false;
+        }
+
+        PdfVariant var;
+        EPdfContentsType type;
+
+        token->fKeyword = NULL;
+        token->fObject = NULL;
+
+        bool ret = fTokenizer->ReadNext(type, token->fKeyword, var);
+
+        if (!ret) return ret;
+
+        switch (type) {
+            case ePdfContentsType_Keyword:
+                token->fType = kKeyword_TokenType;
+                break;
+
+            case ePdfContentsType_Variant: {
+                    token->fType = kObject_TokenType;
+                    PdfObject* obj = new PdfObject(var);
+                    PodofoMapper::map(*fDoc, *obj, &token->fObject);
+                }
+                break;
+
+            case ePdfContentsType_ImageData:
+                token->fType = kImageData_TokenType;
+                // TODO(edisonn): inline images seem to work without it
+                break;
+        }
+#ifdef PDF_TRACE
+        std::string str;
+        if (token->fObject) {
+            token->fObject->podofo()->ToString(str);
+        }
+        printf("%s %s\n", token->fType == kKeyword_TokenType ? "Keyword" : token->fType == kObject_TokenType ? "Object" : "ImageData", token->fKeyword ? token->fKeyword : str.c_str());
+#endif
+        return ret;
+    }
+};
+
+class SkPdfDoc {
+    PdfMemDocument fDoc;
+public:
+
+    PdfMemDocument& podofo() {return fDoc;}
+
+    SkPdfDoc(const char* path) : fDoc(path) {}
+
+    int pages() {
+        return fDoc.GetPageCount();
+    }
+
+    // Can return NULL
+    SkPdfPageObjectDictionary* page(int n) {
+        SkPdfPageObjectDictionary* page = NULL;
+        PodofoMapper::map(fDoc, *fDoc.GetPage(n)->GetObject(), &page);
+        return page;
+    }
+
+    SkRect MediaBox(int n) {
+        PdfRect rect = fDoc.GetPage(n)->GetMediaBox();
+        SkRect skrect = SkRect::MakeLTRB(SkDoubleToScalar(rect.GetLeft()),
+                                         SkDoubleToScalar(rect.GetBottom()),
+                                         SkDoubleToScalar(rect.GetLeft() + rect.GetWidth()),
+                                         SkDoubleToScalar(rect.GetBottom() + rect.GetHeight()));
+        return skrect;
+    }
+
+    SkPdfTokenizer* tokenizerOfPage(int n) {
+        PdfContentsTokenizer* t = new PdfContentsTokenizer(fDoc.GetPage(n));
+        return new SkPdfTokenizer(&fDoc, t);
+    }
+};
+
+#endif  // SkPdfParser_DEFINED
diff --git a/experimental/PdfViewer/SkPdfType3FontDictionary_autogen.h b/experimental/PdfViewer/SkPdfType3FontDictionary_autogen.h
deleted file mode 100644
index 83c5b32..0000000
--- a/experimental/PdfViewer/SkPdfType3FontDictionary_autogen.h
+++ /dev/null
@@ -1,104 +0,0 @@
-#ifndef __DEFINED__SkPdfType3FontDictionary
-#define __DEFINED__SkPdfType3FontDictionary
-
-#include "SkPdfEnums_autogen.h"
-#include "SkPdfArray_autogen.h"
-#include "SkPdfType0FontDictionary_autogen.h"
-
-// Entries in a Type 3 font dictionary
-class SkPdfType3FontDictionary : public SkPdfType0FontDictionary {
-public:
-  virtual SkPdfObjectType getType() const { return kType3FontDictionary_SkPdfObjectType;}
-  virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType3FontDictionary_SkPdfObjectType + 1);}
-public:
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return this;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return this;}
-
-private:
-public:
-private:
-public:
-  SkPdfType3FontDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfType0FontDictionary(podofoDoc, podofoObj) {}
-
-  virtual bool valid() const {return true;}
-
-  SkPdfType3FontDictionary& operator=(const SkPdfType3FontDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
-
-/** (Required) The type of PDF object that this dictionary describes; must be
- *  Font for a font dictionary.
-**/
-  bool has_Type() const {
-    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "", NULL));
-  }
-
-  std::string Type() const {
-    std::string ret;
-    if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "", &ret)) return ret;
-    // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return "";
-  }
-
-/** (Required) The type of font; must be Type3 for a Type 3 font.
-**/
-  bool has_Subtype() const {
-    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "", NULL));
-  }
-
-  std::string Subtype() const {
-    std::string ret;
-    if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "", &ret)) return ret;
-    // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return "";
-  }
-
-/** (Required in PDF 1.0; optional otherwise) See Table 5.8 on page 317.
-**/
-  bool has_Name() const {
-    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name", "", NULL));
-  }
-
-  std::string Name() const {
-    std::string ret;
-    if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name", "", &ret)) return ret;
-    // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return "";
-  }
-
-/** (Required) A rectangle (see Section 3.8.3, "Rectangles"), expressed in the
- *  glyph coordinate system, specifying the font bounding box. This is the small-
- *  est rectangle enclosing the shape that would result if all of the glyphs of the
- *  font were placed with their origins coincident and then filled.
- *  If all four elements of the rectangle are zero, no assumptions are made based
- *  on the font bounding box. If any element is nonzero, it is essential that the
- *  font bounding box be accurate; if any glyph's marks fall outside this bound-
- *  ing box, incorrect behavior may result.
-**/
-  bool has_FontBBox() const {
-    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontBBox", "", NULL));
-  }
-
-  SkRect FontBBox() const {
-    SkRect ret;
-    if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontBBox", "", &ret)) return ret;
-    // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
-  }
-
-/** (Required) An array of six numbers specifying the font matrix, mapping
- *  glyph space to text space (see Section 5.1.3, "Glyph Positioning and
- *  Metrics"). A common practice is to define glyphs in terms of a 1000-unit
-**/
-  bool has_FontMatrix() const {
-    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontMatrix", "", NULL));
-  }
-
-  SkPdfArray FontMatrix() const {
-    SkPdfArray ret;
-    if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontMatrix", "", &ret)) return ret;
-    // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
-  }
-
-};
-
-#endif  // __DEFINED__SkPdfType3FontDictionary
diff --git a/experimental/PdfViewer/SkPdfUtils.cpp b/experimental/PdfViewer/SkPdfUtils.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/experimental/PdfViewer/SkPdfUtils.cpp
diff --git a/experimental/PdfViewer/SkPdfUtils.h b/experimental/PdfViewer/SkPdfUtils.h
new file mode 100644
index 0000000..970b6c1
--- /dev/null
+++ b/experimental/PdfViewer/SkPdfUtils.h
@@ -0,0 +1,126 @@
+#ifndef __DEFINED__SkPdfUtils
+#define __DEFINED__SkPdfUtils
+
+#include "podofo.h"
+using namespace PoDoFo;
+
+#include "SkPdfBasics.h"
+
+const PdfObject* resolveReferenceObject(const PdfMemDocument* pdfDoc,
+                                  const PdfObject* obj,
+                                  bool resolveOneElementArrays = false);
+
+bool LongFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        long* data);
+
+bool DoubleFromDictionary(const PdfMemDocument* pdfDoc,
+                          const PdfDictionary& dict,
+                          const char* key,
+                          const char* abr,
+                          double* data);
+
+bool BoolFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        bool* data);
+
+bool NameFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        std::string* data);
+
+bool StringFromDictionary(const PdfMemDocument* pdfDoc,
+                          const PdfDictionary& dict,
+                          const char* key,
+                          const char* abr,
+                          std::string* data);
+
+class SkPdfDictionary;
+bool DictionaryFromDictionary(const PdfMemDocument* pdfDoc,
+                              const PdfDictionary& dict,
+                              const char* key,
+                              const char* abr,
+                              SkPdfDictionary** data);
+
+template <typename T>
+bool DictionaryFromDictionary2(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        T** data);
+
+class SkPdfObject;
+bool ObjectFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        SkPdfObject** data);
+
+
+struct SkPdfFileSpec {};
+class SkPdfArray;
+class SkPdfStream;
+struct SkPdfDate {};
+struct SkPdfTree {};
+struct SkPdfFunction {};
+
+bool ArrayFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        SkPdfArray** data);
+
+bool SkMatrixFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        SkMatrix** data);
+
+bool FileSpecFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        SkPdfFileSpec* data);
+
+
+bool StreamFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        SkPdfStream** data);
+
+bool TreeFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        SkPdfTree** data);
+
+bool DateFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        SkPdfDate* data);
+
+bool SkRectFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        SkRect** data);
+
+bool FunctionFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        SkPdfFunction* data);
+
+bool skpdfmap(const PdfMemDocument& podofoDoc, const PdfObject& podofoObj, SkPdfObject** out);
+SkMatrix SkMatrixFromPdfArray(SkPdfArray* pdfArray);
+
+PdfResult doType3Char(PdfContext* pdfContext, SkCanvas* canvas, SkPdfObject* skobj, SkRect bBox, SkMatrix matrix, double textSize);
+
+#endif   // __DEFINED__SkPdfUtils
diff --git a/experimental/PdfViewer/SkPdfALinkAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfALinkAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfALinkAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfALinkAnnotationDictionary_autogen.h
index 5cf2047..920043b 100644
--- a/experimental/PdfViewer/SkPdfALinkAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfALinkAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfALinkAnnotationDictionary
 #define __DEFINED__SkPdfALinkAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfALinkAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfALinkAnnotationDictionary(const SkPdfALinkAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfALinkAnnotationDictionary& operator=(const SkPdfALinkAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -566,11 +569,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getDestAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getDestAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
   bool isDestAName() const {
diff --git a/experimental/PdfViewer/SkPdfActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfActionDictionary_autogen.h
index 7add016..b7fa6d0 100644
--- a/experimental/PdfViewer/SkPdfActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfActionDictionary
 #define __DEFINED__SkPdfActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfActionDictionary(const SkPdfActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfActionDictionary& operator=(const SkPdfActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -578,11 +581,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getNextAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getNextAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Next", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfAlternateImageDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfAlternateImageDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfAlternateImageDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfAlternateImageDictionary_autogen.h
index b2012c3..5ab6a9d 100644
--- a/experimental/PdfViewer/SkPdfAlternateImageDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfAlternateImageDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfAlternateImageDictionary
 #define __DEFINED__SkPdfAlternateImageDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfAlternateImageDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfAlternateImageDictionary(const SkPdfAlternateImageDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfAlternateImageDictionary& operator=(const SkPdfAlternateImageDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfAnnotationActionsDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfAnnotationActionsDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfAnnotationActionsDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfAnnotationActionsDictionary_autogen.h
index 36e8f0b..01e1ffe 100644
--- a/experimental/PdfViewer/SkPdfAnnotationActionsDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfAnnotationActionsDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfAnnotationActionsDictionary
 #define __DEFINED__SkPdfAnnotationActionsDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfAnnotationActionsDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfAnnotationActionsDictionary(const SkPdfAnnotationActionsDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfAnnotationActionsDictionary& operator=(const SkPdfAnnotationActionsDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfAnnotationDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfAnnotationDictionary_autogen.h
index 9fb25f0..5276f64 100644
--- a/experimental/PdfViewer/SkPdfAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfAnnotationDictionary
 #define __DEFINED__SkPdfAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfAnnotationDictionary(const SkPdfAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfAnnotationDictionary& operator=(const SkPdfAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -589,11 +592,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rect", "", NULL));
   }
 
-  SkRect Rect() const {
-    SkRect ret;
+  SkRect* Rect() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rect", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Optional; PDF 1.4) The annotation name, a text string uniquely identifying
@@ -697,11 +700,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Border", "", NULL));
   }
 
-  SkPdfArray Border() const {
-    SkPdfArray ret;
+  SkPdfArray* Border() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Border", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.2) An appearance dictionary specifying how the annotation
@@ -746,11 +749,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", NULL));
   }
 
-  SkPdfArray C() const {
-    SkPdfArray ret;
+  SkPdfArray* C() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.4) The constant opacity value to be used in painting the
diff --git a/experimental/PdfViewer/SkPdfAppearanceCharacteristicsDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfAppearanceCharacteristicsDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfAppearanceCharacteristicsDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfAppearanceCharacteristicsDictionary_autogen.h
index 03a506a..75a0038 100644
--- a/experimental/PdfViewer/SkPdfAppearanceCharacteristicsDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfAppearanceCharacteristicsDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfAppearanceCharacteristicsDictionary
 #define __DEFINED__SkPdfAppearanceCharacteristicsDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfAppearanceCharacteristicsDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfAppearanceCharacteristicsDictionary(const SkPdfAppearanceCharacteristicsDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfAppearanceCharacteristicsDictionary& operator=(const SkPdfAppearanceCharacteristicsDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -549,11 +552,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BC", "", NULL));
   }
 
-  SkPdfArray BC() const {
-    SkPdfArray ret;
+  SkPdfArray* BC() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BC", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of numbers in the range 0.0 to 1.0 specifying the color of the
@@ -564,11 +567,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG", "", NULL));
   }
 
-  SkPdfArray BG() const {
-    SkPdfArray ret;
+  SkPdfArray* BG() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BG", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; button fields only) The widget annotation's normal caption, displayed
diff --git a/experimental/PdfViewer/SkPdfAppearanceDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfAppearanceDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfAppearanceDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfAppearanceDictionary_autogen.h
index 95567b4..1554916 100644
--- a/experimental/PdfViewer/SkPdfAppearanceDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfAppearanceDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfAppearanceDictionary
 #define __DEFINED__SkPdfAppearanceDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfAppearanceDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfAppearanceDictionary(const SkPdfAppearanceDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfAppearanceDictionary& operator=(const SkPdfAppearanceDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfApplicationDataDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfApplicationDataDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfApplicationDataDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfApplicationDataDictionary_autogen.h
index 1a4618e..4bf61d8 100644
--- a/experimental/PdfViewer/SkPdfApplicationDataDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfApplicationDataDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfApplicationDataDictionary
 #define __DEFINED__SkPdfApplicationDataDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfApplicationDataDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfApplicationDataDictionary(const SkPdfApplicationDataDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfApplicationDataDictionary& operator=(const SkPdfApplicationDataDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfArray_autogen.h b/experimental/PdfViewer/autogen/SkPdfArray_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfArray_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfArray_autogen.h
index d9671eb..3c34cea 100644
--- a/experimental/PdfViewer/SkPdfArray_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfArray_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfArray
 #define __DEFINED__SkPdfArray
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfObject_autogen.h"
@@ -173,9 +174,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -185,6 +183,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -552,6 +553,8 @@
 public:
   SkPdfArray(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfObject(podofoDoc, podofoObj) {}
 
+  SkPdfArray(const SkPdfArray& from) : SkPdfObject(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfArray& operator=(const SkPdfArray& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfArtifactsDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfArtifactsDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfArtifactsDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfArtifactsDictionary_autogen.h
index 872b048..9cae252 100644
--- a/experimental/PdfViewer/SkPdfArtifactsDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfArtifactsDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfArtifactsDictionary
 #define __DEFINED__SkPdfArtifactsDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfArtifactsDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfArtifactsDictionary(const SkPdfArtifactsDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfArtifactsDictionary& operator=(const SkPdfArtifactsDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -544,11 +547,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BBox", "", NULL));
   }
 
-  SkRect BBox() const {
-    SkRect ret;
+  SkRect* BBox() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BBox", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Optional; pagination artifacts only) An array of name objects containing one to
@@ -562,11 +565,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Attached", "", NULL));
   }
 
-  SkPdfArray Attached() const {
-    SkPdfArray ret;
+  SkPdfArray* Attached() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Attached", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfAttributeObjectDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfAttributeObjectDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfAttributeObjectDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfAttributeObjectDictionary_autogen.h
index b1d0423..d389fc4 100644
--- a/experimental/PdfViewer/SkPdfAttributeObjectDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfAttributeObjectDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfAttributeObjectDictionary
 #define __DEFINED__SkPdfAttributeObjectDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfAttributeObjectDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfAttributeObjectDictionary(const SkPdfAttributeObjectDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfAttributeObjectDictionary& operator=(const SkPdfAttributeObjectDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfBeadDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfBeadDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfBeadDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfBeadDictionary_autogen.h
index 1da4af7..4b479c0 100644
--- a/experimental/PdfViewer/SkPdfBeadDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfBeadDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfBeadDictionary
 #define __DEFINED__SkPdfBeadDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfBeadDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfBeadDictionary(const SkPdfBeadDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfBeadDictionary& operator=(const SkPdfBeadDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -600,11 +603,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "R", "", NULL));
   }
 
-  SkRect R() const {
-    SkRect ret;
+  SkRect* R() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "R", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfBlockLevelStructureElementsDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfBlockLevelStructureElementsDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfBlockLevelStructureElementsDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfBlockLevelStructureElementsDictionary_autogen.h
index 78a7de0..88dd0c7 100644
--- a/experimental/PdfViewer/SkPdfBlockLevelStructureElementsDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfBlockLevelStructureElementsDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfBlockLevelStructureElementsDictionary
 #define __DEFINED__SkPdfBlockLevelStructureElementsDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfBlockLevelStructureElementsDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfBlockLevelStructureElementsDictionary(const SkPdfBlockLevelStructureElementsDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfBlockLevelStructureElementsDictionary& operator=(const SkPdfBlockLevelStructureElementsDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -665,11 +668,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BBox", "", NULL));
   }
 
-  SkRect BBox() const {
-    SkRect ret;
+  SkRect* BBox() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BBox", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Optional; illustrations, tables, table headers, and table cells only; strongly
diff --git a/experimental/PdfViewer/SkPdfBoolean_autogen.h b/experimental/PdfViewer/autogen/SkPdfBoolean_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfBoolean_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfBoolean_autogen.h
index 72540e8..1a0ba84 100644
--- a/experimental/PdfViewer/SkPdfBoolean_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfBoolean_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfBoolean
 #define __DEFINED__SkPdfBoolean
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfObject_autogen.h"
@@ -173,9 +174,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -185,6 +183,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -551,6 +552,8 @@
 public:
   SkPdfBoolean(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfObject(podofoDoc, podofoObj) {}
 
+  SkPdfBoolean(const SkPdfBoolean& from) : SkPdfObject(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfBoolean& operator=(const SkPdfBoolean& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfBorderStyleDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfBorderStyleDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfBorderStyleDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfBorderStyleDictionary_autogen.h
index a4110e1..5513a0e 100644
--- a/experimental/PdfViewer/SkPdfBorderStyleDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfBorderStyleDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfBorderStyleDictionary
 #define __DEFINED__SkPdfBorderStyleDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfBorderStyleDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfBorderStyleDictionary(const SkPdfBorderStyleDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfBorderStyleDictionary& operator=(const SkPdfBorderStyleDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -584,11 +587,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", NULL));
   }
 
-  SkPdfArray D() const {
-    SkPdfArray ret;
+  SkPdfArray* D() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfBoxColorInformationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfBoxColorInformationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfBoxColorInformationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfBoxColorInformationDictionary_autogen.h
index b5148f9..c50cfea 100644
--- a/experimental/PdfViewer/SkPdfBoxColorInformationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfBoxColorInformationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfBoxColorInformationDictionary
 #define __DEFINED__SkPdfBoxColorInformationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfBoxColorInformationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfBoxColorInformationDictionary(const SkPdfBoxColorInformationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfBoxColorInformationDictionary& operator=(const SkPdfBoxColorInformationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfBoxStyleDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfBoxStyleDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfBoxStyleDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfBoxStyleDictionary_autogen.h
index bd340e5..d68b868 100644
--- a/experimental/PdfViewer/SkPdfBoxStyleDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfBoxStyleDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfBoxStyleDictionary
 #define __DEFINED__SkPdfBoxStyleDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfBoxStyleDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfBoxStyleDictionary(const SkPdfBoxStyleDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfBoxStyleDictionary& operator=(const SkPdfBoxStyleDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -530,11 +533,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", NULL));
   }
 
-  SkPdfArray C() const {
-    SkPdfArray ret;
+  SkPdfArray* C() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) The guideline width in default user space units. Default value: 1.
@@ -578,11 +581,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", NULL));
   }
 
-  SkPdfArray D() const {
-    SkPdfArray ret;
+  SkPdfArray* D() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfCIDFontDescriptorDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfCIDFontDescriptorDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfCIDFontDescriptorDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfCIDFontDescriptorDictionary_autogen.h
index 7faf8be..4693429 100644
--- a/experimental/PdfViewer/SkPdfCIDFontDescriptorDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfCIDFontDescriptorDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfCIDFontDescriptorDictionary
 #define __DEFINED__SkPdfCIDFontDescriptorDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfCIDFontDescriptorDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfCIDFontDescriptorDictionary(const SkPdfCIDFontDescriptorDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfCIDFontDescriptorDictionary& operator=(const SkPdfCIDFontDescriptorDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfCIDFontDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfCIDFontDictionary_autogen.h
similarity index 96%
rename from experimental/PdfViewer/SkPdfCIDFontDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfCIDFontDictionary_autogen.h
index a25e714..c213bad 100644
--- a/experimental/PdfViewer/SkPdfCIDFontDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfCIDFontDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfCIDFontDictionary
 #define __DEFINED__SkPdfCIDFontDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfFontDictionary_autogen.h"
@@ -18,9 +19,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -30,11 +28,16 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
 public:
 private:
 public:
   SkPdfCIDFontDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfFontDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfCIDFontDictionary(const SkPdfCIDFontDictionary& from) : SkPdfFontDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfCIDFontDictionary& operator=(const SkPdfCIDFontDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -136,11 +139,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "W", "", NULL));
   }
 
-  SkPdfArray W() const {
-    SkPdfArray ret;
+  SkPdfArray* W() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "W", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; applies only to CIDFonts used for vertical writing) An array of two
@@ -151,11 +154,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DW2", "", NULL));
   }
 
-  SkPdfArray DW2() const {
-    SkPdfArray ret;
+  SkPdfArray* DW2() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DW2", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; applies only to CIDFonts used for vertical writing) A description of
@@ -167,11 +170,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "W2", "", NULL));
   }
 
-  SkPdfArray W2() const {
-    SkPdfArray ret;
+  SkPdfArray* W2() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "W2", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; Type 2 CIDFonts only) A specification of the mapping from CIDs
diff --git a/experimental/PdfViewer/SkPdfCIDSystemInfoDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfCIDSystemInfoDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfCIDSystemInfoDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfCIDSystemInfoDictionary_autogen.h
index 2aab84d..a23f106 100644
--- a/experimental/PdfViewer/SkPdfCIDSystemInfoDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfCIDSystemInfoDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfCIDSystemInfoDictionary
 #define __DEFINED__SkPdfCIDSystemInfoDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfCIDSystemInfoDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfCIDSystemInfoDictionary(const SkPdfCIDSystemInfoDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfCIDSystemInfoDictionary& operator=(const SkPdfCIDSystemInfoDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfCMapDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfCMapDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfCMapDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfCMapDictionary_autogen.h
index 52723c5..98d95f4 100644
--- a/experimental/PdfViewer/SkPdfCMapDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfCMapDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfCMapDictionary
 #define __DEFINED__SkPdfCMapDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfCMapDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfCMapDictionary(const SkPdfCMapDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfCMapDictionary& operator=(const SkPdfCMapDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -590,11 +593,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getCIDSystemInfoAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getCIDSystemInfoAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CIDSystemInfo", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A code that determines the writing mode for any CIDFont with
diff --git a/experimental/PdfViewer/SkPdfCalgrayColorSpaceDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfCalgrayColorSpaceDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfCalgrayColorSpaceDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfCalgrayColorSpaceDictionary_autogen.h
index fa99b55..e7b79e1 100644
--- a/experimental/PdfViewer/SkPdfCalgrayColorSpaceDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfCalgrayColorSpaceDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfCalgrayColorSpaceDictionary
 #define __DEFINED__SkPdfCalgrayColorSpaceDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfCalgrayColorSpaceDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfCalgrayColorSpaceDictionary(const SkPdfCalgrayColorSpaceDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfCalgrayColorSpaceDictionary& operator=(const SkPdfCalgrayColorSpaceDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -531,11 +534,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "WhitePoint", "", NULL));
   }
 
-  SkPdfArray WhitePoint() const {
-    SkPdfArray ret;
+  SkPdfArray* WhitePoint() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "WhitePoint", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of three numbers [ XB YB ZB ] specifying the tristimulus
@@ -547,11 +550,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BlackPoint", "", NULL));
   }
 
-  SkPdfArray BlackPoint() const {
-    SkPdfArray ret;
+  SkPdfArray* BlackPoint() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BlackPoint", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A number G defining the gamma for the gray (A) component. G
diff --git a/experimental/PdfViewer/SkPdfCalrgbColorSpaceDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfCalrgbColorSpaceDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfCalrgbColorSpaceDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfCalrgbColorSpaceDictionary_autogen.h
index 58888fe..b3b5a3d 100644
--- a/experimental/PdfViewer/SkPdfCalrgbColorSpaceDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfCalrgbColorSpaceDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfCalrgbColorSpaceDictionary
 #define __DEFINED__SkPdfCalrgbColorSpaceDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfCalrgbColorSpaceDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfCalrgbColorSpaceDictionary(const SkPdfCalrgbColorSpaceDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfCalrgbColorSpaceDictionary& operator=(const SkPdfCalrgbColorSpaceDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -530,11 +533,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "WhitePoint", "", NULL));
   }
 
-  SkPdfArray WhitePoint() const {
-    SkPdfArray ret;
+  SkPdfArray* WhitePoint() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "WhitePoint", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of three numbers [ XB YB ZB ] specifying the tristimulus value, in
@@ -545,11 +548,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BlackPoint", "", NULL));
   }
 
-  SkPdfArray BlackPoint() const {
-    SkPdfArray ret;
+  SkPdfArray* BlackPoint() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BlackPoint", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of three numbers [ GR GG GB ] specifying the gamma for the red,
@@ -560,11 +563,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Gamma", "", NULL));
   }
 
-  SkPdfArray Gamma() const {
-    SkPdfArray ret;
+  SkPdfArray* Gamma() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Gamma", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of nine numbers [ XA YA ZA XB YB ZB XC YC ZC ] specifying
@@ -576,11 +579,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", "", NULL));
   }
 
-  SkPdfArray Matrix() const {
-    SkPdfArray ret;
+  SkPdfArray* Matrix() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfCatalogDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfCatalogDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfCatalogDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfCatalogDictionary_autogen.h
index 1f9ca32..021f118 100644
--- a/experimental/PdfViewer/SkPdfCatalogDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfCatalogDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfCatalogDictionary
 #define __DEFINED__SkPdfCatalogDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfCatalogDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfCatalogDictionary(const SkPdfCatalogDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfCatalogDictionary& operator=(const SkPdfCatalogDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -720,11 +723,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Threads", "", NULL));
   }
 
-  SkPdfArray Threads() const {
-    SkPdfArray ret;
+  SkPdfArray* Threads() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Threads", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.1) A value specifying a destination to be displayed or
@@ -744,11 +747,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getOpenActionAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getOpenActionAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OpenAction", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
   bool isOpenActionADictionary() const {
@@ -893,11 +896,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OutputIntents", "", NULL));
   }
 
-  SkPdfArray OutputIntents() const {
-    SkPdfArray ret;
+  SkPdfArray* OutputIntents() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OutputIntents", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfCcittfaxdecodeFilterDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfCcittfaxdecodeFilterDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfCcittfaxdecodeFilterDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfCcittfaxdecodeFilterDictionary_autogen.h
index 91ce1ba..d4701fb 100644
--- a/experimental/PdfViewer/SkPdfCcittfaxdecodeFilterDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfCcittfaxdecodeFilterDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfCcittfaxdecodeFilterDictionary
 #define __DEFINED__SkPdfCcittfaxdecodeFilterDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfCcittfaxdecodeFilterDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfCcittfaxdecodeFilterDictionary(const SkPdfCcittfaxdecodeFilterDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfCcittfaxdecodeFilterDictionary& operator=(const SkPdfCcittfaxdecodeFilterDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfCheckboxFieldDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfCheckboxFieldDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfCheckboxFieldDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfCheckboxFieldDictionary_autogen.h
index 9f39499..9661ed9 100644
--- a/experimental/PdfViewer/SkPdfCheckboxFieldDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfCheckboxFieldDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfCheckboxFieldDictionary
 #define __DEFINED__SkPdfCheckboxFieldDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfCheckboxFieldDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfCheckboxFieldDictionary(const SkPdfCheckboxFieldDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfCheckboxFieldDictionary& operator=(const SkPdfCheckboxFieldDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfChoiceFieldDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfChoiceFieldDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfChoiceFieldDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfChoiceFieldDictionary_autogen.h
index 7054e7a..6aec3e8 100644
--- a/experimental/PdfViewer/SkPdfChoiceFieldDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfChoiceFieldDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfChoiceFieldDictionary
 #define __DEFINED__SkPdfChoiceFieldDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfChoiceFieldDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfChoiceFieldDictionary(const SkPdfChoiceFieldDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfChoiceFieldDictionary& operator=(const SkPdfChoiceFieldDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -532,11 +535,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Opt", "", NULL));
   }
 
-  SkPdfArray Opt() const {
-    SkPdfArray ret;
+  SkPdfArray* Opt() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Opt", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; inheritable) For scrollable list boxes, the top index (the index in the Opt array
@@ -565,11 +568,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "I", "", NULL));
   }
 
-  SkPdfArray I() const {
-    SkPdfArray ret;
+  SkPdfArray* I() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "I", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfComponentsWithMetadataDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfComponentsWithMetadataDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfComponentsWithMetadataDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfComponentsWithMetadataDictionary_autogen.h
index dbf256e..401b090 100644
--- a/experimental/PdfViewer/SkPdfComponentsWithMetadataDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfComponentsWithMetadataDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfComponentsWithMetadataDictionary
 #define __DEFINED__SkPdfComponentsWithMetadataDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfComponentsWithMetadataDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfComponentsWithMetadataDictionary(const SkPdfComponentsWithMetadataDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfComponentsWithMetadataDictionary& operator=(const SkPdfComponentsWithMetadataDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfDctdecodeFilterDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfDctdecodeFilterDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfDctdecodeFilterDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfDctdecodeFilterDictionary_autogen.h
index 8e42fd2..7d13d01 100644
--- a/experimental/PdfViewer/SkPdfDctdecodeFilterDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfDctdecodeFilterDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfDctdecodeFilterDictionary
 #define __DEFINED__SkPdfDctdecodeFilterDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfDctdecodeFilterDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfDctdecodeFilterDictionary(const SkPdfDctdecodeFilterDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfDctdecodeFilterDictionary& operator=(const SkPdfDctdecodeFilterDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfDeviceNColorSpaceDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfDeviceNColorSpaceDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfDeviceNColorSpaceDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfDeviceNColorSpaceDictionary_autogen.h
index b9cda4b..ec96dbc 100644
--- a/experimental/PdfViewer/SkPdfDeviceNColorSpaceDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfDeviceNColorSpaceDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfDeviceNColorSpaceDictionary
 #define __DEFINED__SkPdfDeviceNColorSpaceDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfDeviceNColorSpaceDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfDeviceNColorSpaceDictionary(const SkPdfDeviceNColorSpaceDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfDeviceNColorSpaceDictionary& operator=(const SkPdfDeviceNColorSpaceDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfDictionary_autogen.h
similarity index 80%
rename from experimental/PdfViewer/SkPdfDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfDictionary_autogen.h
index 07fcd3b..3fe1c07 100644
--- a/experimental/PdfViewer/SkPdfDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfDictionary
 #define __DEFINED__SkPdfDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfObject_autogen.h"
@@ -45,12 +46,14 @@
   virtual const SkPdfHexString* asHexString() const {return NULL;}
 
 public:
-  const SkPdfObject get(const char* dictionaryKeyName) const {return SkPdfObject(fPodofoDoc, resolveReferenceObject(fPodofoDoc, fPodofoObj->GetDictionary().GetKey(PdfName(dictionaryKeyName))));}
-  SkPdfObject get(const char* dictionaryKeyName) {return SkPdfObject(fPodofoDoc, resolveReferenceObject(fPodofoDoc, fPodofoObj->GetDictionary().GetKey(PdfName(dictionaryKeyName))));}
+  SkPdfObject* get(const char* dictionaryKeyName) const {return new SkPdfObject(fPodofoDoc, resolveReferenceObject(fPodofoDoc, fPodofoObj->GetDictionary().GetKey(PdfName(dictionaryKeyName))));}
+  SkPdfObject* get(const char* dictionaryKeyName) {return new SkPdfObject(fPodofoDoc, resolveReferenceObject(fPodofoDoc, fPodofoObj->GetDictionary().GetKey(PdfName(dictionaryKeyName))));}
 private:
 public:
   SkPdfDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfObject(podofoDoc, podofoObj) {}
 
+  SkPdfDictionary(const SkPdfDictionary& from) : SkPdfObject(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfDictionary& operator=(const SkPdfDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfDocumentCatalogActionsDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfDocumentCatalogActionsDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfDocumentCatalogActionsDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfDocumentCatalogActionsDictionary_autogen.h
index 1fea025..515825a 100644
--- a/experimental/PdfViewer/SkPdfDocumentCatalogActionsDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfDocumentCatalogActionsDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfDocumentCatalogActionsDictionary
 #define __DEFINED__SkPdfDocumentCatalogActionsDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfDocumentCatalogActionsDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfDocumentCatalogActionsDictionary(const SkPdfDocumentCatalogActionsDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfDocumentCatalogActionsDictionary& operator=(const SkPdfDocumentCatalogActionsDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfDocumentInformationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfDocumentInformationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfDocumentInformationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfDocumentInformationDictionary_autogen.h
index 2a06574..34e88fa 100644
--- a/experimental/PdfViewer/SkPdfDocumentInformationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfDocumentInformationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfDocumentInformationDictionary
 #define __DEFINED__SkPdfDocumentInformationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfDocumentInformationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfDocumentInformationDictionary(const SkPdfDocumentInformationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfDocumentInformationDictionary& operator=(const SkPdfDocumentInformationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfEmbeddedFileParameterDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfEmbeddedFileParameterDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfEmbeddedFileParameterDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfEmbeddedFileParameterDictionary_autogen.h
index b152450..fedb722 100644
--- a/experimental/PdfViewer/SkPdfEmbeddedFileParameterDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfEmbeddedFileParameterDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfEmbeddedFileParameterDictionary
 #define __DEFINED__SkPdfEmbeddedFileParameterDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfEmbeddedFileParameterDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfEmbeddedFileParameterDictionary(const SkPdfEmbeddedFileParameterDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfEmbeddedFileParameterDictionary& operator=(const SkPdfEmbeddedFileParameterDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfEmbeddedFileStreamDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfEmbeddedFileStreamDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfEmbeddedFileStreamDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfEmbeddedFileStreamDictionary_autogen.h
index c90d693b..96479fc 100644
--- a/experimental/PdfViewer/SkPdfEmbeddedFileStreamDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfEmbeddedFileStreamDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfEmbeddedFileStreamDictionary
 #define __DEFINED__SkPdfEmbeddedFileStreamDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfEmbeddedFileStreamDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfEmbeddedFileStreamDictionary(const SkPdfEmbeddedFileStreamDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfEmbeddedFileStreamDictionary& operator=(const SkPdfEmbeddedFileStreamDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfEmbeddedFontStreamDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfEmbeddedFontStreamDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfEmbeddedFontStreamDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfEmbeddedFontStreamDictionary_autogen.h
index fad070e..1c55026 100644
--- a/experimental/PdfViewer/SkPdfEmbeddedFontStreamDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfEmbeddedFontStreamDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfEmbeddedFontStreamDictionary
 #define __DEFINED__SkPdfEmbeddedFontStreamDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfEmbeddedFontStreamDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfEmbeddedFontStreamDictionary(const SkPdfEmbeddedFontStreamDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfEmbeddedFontStreamDictionary& operator=(const SkPdfEmbeddedFontStreamDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfEncodingDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfEncodingDictionary_autogen.h
similarity index 96%
rename from experimental/PdfViewer/SkPdfEncodingDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfEncodingDictionary_autogen.h
index 3c92f28..293bba4 100644
--- a/experimental/PdfViewer/SkPdfEncodingDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfEncodingDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfEncodingDictionary
 #define __DEFINED__SkPdfEncodingDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfEncodingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfEncodingDictionary(const SkPdfEncodingDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfEncodingDictionary& operator=(const SkPdfEncodingDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -561,16 +564,30 @@
 /** (Optional; not recommended with TrueType fonts) An array describing the differ-
  *  ences from the encoding specified by BaseEncoding or, if BaseEncoding is ab-
  *  sent, from an implicit base encoding. The Differences array is described above.
+ *     The value of the Differences entry is an array of character codes and character
+ *     names organized as follows:
+ *          code1 name1,1 name1,2 ...
+ *          code2 name2,1 name2,2 ...
+ *          ...
+ *          coden namen,1 namen,2 ...
+ *     Each code is the first index in a sequence of characters to be changed. The first
+ *     character name after the code becomes the name corresponding to that code.
+ *     Subsequent names replace consecutive code indices until the next code appears in
+ *     the array or the array ends. These sequences may be specified in any order but
+ *     should not overlap.
+ *     For example, in the encoding dictionary in Example 5.10, the name quotesingle
+ *     ( ' ) is associated with character code 39, Adieresis (A) with code 128, Aring (A)
+ *     with 129, and trademark ((TM)) with 170.
 **/
   bool has_Differences() const {
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Differences", "", NULL));
   }
 
-  SkPdfArray Differences() const {
-    SkPdfArray ret;
+  SkPdfArray* Differences() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Differences", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfEncryptedEmbeddedFileStreamDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfEncryptedEmbeddedFileStreamDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfEncryptedEmbeddedFileStreamDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfEncryptedEmbeddedFileStreamDictionary_autogen.h
index 008fb32..77be6d7 100644
--- a/experimental/PdfViewer/SkPdfEncryptedEmbeddedFileStreamDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfEncryptedEmbeddedFileStreamDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfEncryptedEmbeddedFileStreamDictionary
 #define __DEFINED__SkPdfEncryptedEmbeddedFileStreamDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfEncryptedEmbeddedFileStreamDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfEncryptedEmbeddedFileStreamDictionary(const SkPdfEncryptedEmbeddedFileStreamDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfEncryptedEmbeddedFileStreamDictionary& operator=(const SkPdfEncryptedEmbeddedFileStreamDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfEncryptionCommonDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfEncryptionCommonDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfEncryptionCommonDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfEncryptionCommonDictionary_autogen.h
index 4539b26..5470b9b 100644
--- a/experimental/PdfViewer/SkPdfEncryptionCommonDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfEncryptionCommonDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfEncryptionCommonDictionary
 #define __DEFINED__SkPdfEncryptionCommonDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfEncryptionCommonDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfEncryptionCommonDictionary(const SkPdfEncryptionCommonDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfEncryptionCommonDictionary& operator=(const SkPdfEncryptionCommonDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfEnums_autogen.h b/experimental/PdfViewer/autogen/SkPdfEnums_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfEnums_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfEnums_autogen.h
index 1e0e879..a4fcd3a 100644
--- a/experimental/PdfViewer/SkPdfEnums_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfEnums_autogen.h
@@ -57,11 +57,10 @@
   kFontDictionary_SkPdfObjectType,
   kCIDFontDictionary_SkPdfObjectType,
   kType0FontDictionary_SkPdfObjectType,
-  kType3FontDictionary_SkPdfObjectType,
-  kType0FontDictionary__End_SkPdfObjectType,
   kType1FontDictionary_SkPdfObjectType,
   kMultiMasterFontDictionary_SkPdfObjectType,
   kTrueTypeFontDictionary_SkPdfObjectType,
+  kType3FontDictionary_SkPdfObjectType,
   kType1FontDictionary__End_SkPdfObjectType,
   kFontDictionary__End_SkPdfObjectType,
   kFormFieldActionsDictionary_SkPdfObjectType,
diff --git a/experimental/PdfViewer/SkPdfFDFCatalogDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFDFCatalogDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFDFCatalogDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFDFCatalogDictionary_autogen.h
index c7b19d4..baddd5f 100644
--- a/experimental/PdfViewer/SkPdfFDFCatalogDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFDFCatalogDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFDFCatalogDictionary
 #define __DEFINED__SkPdfFDFCatalogDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFDFCatalogDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFDFCatalogDictionary(const SkPdfFDFCatalogDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFDFCatalogDictionary& operator=(const SkPdfFDFCatalogDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfFDFDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFDFDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfFDFDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFDFDictionary_autogen.h
index ae36857..af7fc69 100644
--- a/experimental/PdfViewer/SkPdfFDFDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFDFDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFDFDictionary
 #define __DEFINED__SkPdfFDFDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFDFDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFDFDictionary(const SkPdfFDFDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFDFDictionary& operator=(const SkPdfFDFDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -545,11 +548,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", NULL));
   }
 
-  SkPdfArray ID() const {
-    SkPdfArray ret;
+  SkPdfArray* ID() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of FDF field dictionaries (see "FDF Fields" on
@@ -561,11 +564,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Fields", "", NULL));
   }
 
-  SkPdfArray Fields() const {
-    SkPdfArray ret;
+  SkPdfArray* Fields() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Fields", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A status string to be displayed indicating the result of an
@@ -594,11 +597,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", "", NULL));
   }
 
-  SkPdfArray Pages() const {
-    SkPdfArray ret;
+  SkPdfArray* Pages() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.3) The encoding to be used for any FDF field
@@ -627,11 +630,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annots", "", NULL));
   }
 
-  SkPdfArray Annots() const {
-    SkPdfArray ret;
+  SkPdfArray* Annots() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annots", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.4) A stream containing all the bytes in all incre-
@@ -687,11 +690,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "EmbeddedFDFs", "", NULL));
   }
 
-  SkPdfArray EmbeddedFDFs() const {
-    SkPdfArray ret;
+  SkPdfArray* EmbeddedFDFs() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "EmbeddedFDFs", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.4) A JavaScript dictionary (see Table 8.71) defin-
diff --git a/experimental/PdfViewer/SkPdfFDFFieldDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFDFFieldDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFDFFieldDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFDFFieldDictionary_autogen.h
index 2ce38be..9ece7a9 100644
--- a/experimental/PdfViewer/SkPdfFDFFieldDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFDFFieldDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFDFFieldDictionary
 #define __DEFINED__SkPdfFDFFieldDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFDFFieldDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFDFFieldDictionary(const SkPdfFDFFieldDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFDFFieldDictionary& operator=(const SkPdfFDFFieldDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -530,11 +533,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Kids", "", NULL));
   }
 
-  SkPdfArray Kids() const {
-    SkPdfArray ret;
+  SkPdfArray* Kids() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Kids", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) The partial field name (see "Field Names" on page 532).
@@ -723,11 +726,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Opt", "", NULL));
   }
 
-  SkPdfArray Opt() const {
-    SkPdfArray ret;
+  SkPdfArray* Opt() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Opt", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An action to be performed when this field's widget annotation is activat-
diff --git a/experimental/PdfViewer/SkPdfFDFFileAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFDFFileAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFDFFileAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFDFFileAnnotationDictionary_autogen.h
index 19df322..1e5b26a 100644
--- a/experimental/PdfViewer/SkPdfFDFFileAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFDFFileAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFDFFileAnnotationDictionary
 #define __DEFINED__SkPdfFDFFileAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFDFFileAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFDFFileAnnotationDictionary(const SkPdfFDFFileAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFDFFileAnnotationDictionary& operator=(const SkPdfFDFFileAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfFDFNamedPageReferenceDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFDFNamedPageReferenceDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFDFNamedPageReferenceDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFDFNamedPageReferenceDictionary_autogen.h
index 9be142d..41b765f 100644
--- a/experimental/PdfViewer/SkPdfFDFNamedPageReferenceDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFDFNamedPageReferenceDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFDFNamedPageReferenceDictionary
 #define __DEFINED__SkPdfFDFNamedPageReferenceDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFDFNamedPageReferenceDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFDFNamedPageReferenceDictionary(const SkPdfFDFNamedPageReferenceDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFDFNamedPageReferenceDictionary& operator=(const SkPdfFDFNamedPageReferenceDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfFDFPageDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFDFPageDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFDFPageDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFDFPageDictionary_autogen.h
index bc5a546..509bd7b 100644
--- a/experimental/PdfViewer/SkPdfFDFPageDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFDFPageDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFDFPageDictionary
 #define __DEFINED__SkPdfFDFPageDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFDFPageDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFDFPageDictionary(const SkPdfFDFPageDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFDFPageDictionary& operator=(const SkPdfFDFPageDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -529,11 +532,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Templates", "", NULL));
   }
 
-  SkPdfArray Templates() const {
-    SkPdfArray ret;
+  SkPdfArray* Templates() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Templates", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An FDF page information dictionary containing additional informa-
diff --git a/experimental/PdfViewer/SkPdfFDFTemplateDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFDFTemplateDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFDFTemplateDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFDFTemplateDictionary_autogen.h
index 75c5be1..92bfa1a 100644
--- a/experimental/PdfViewer/SkPdfFDFTemplateDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFDFTemplateDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFDFTemplateDictionary
 #define __DEFINED__SkPdfFDFTemplateDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFDFTemplateDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFDFTemplateDictionary(const SkPdfFDFTemplateDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFDFTemplateDictionary& operator=(const SkPdfFDFTemplateDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -544,11 +547,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Fields", "", NULL));
   }
 
-  SkPdfArray Fields() const {
-    SkPdfArray ret;
+  SkPdfArray* Fields() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Fields", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A flag specifying whether fields imported from the template may be
diff --git a/experimental/PdfViewer/SkPdfFDFTrailerDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFDFTrailerDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFDFTrailerDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFDFTrailerDictionary_autogen.h
index c35a9fa..12ac84c 100644
--- a/experimental/PdfViewer/SkPdfFDFTrailerDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFDFTrailerDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFDFTrailerDictionary
 #define __DEFINED__SkPdfFDFTrailerDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFDFTrailerDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFDFTrailerDictionary(const SkPdfFDFTrailerDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFDFTrailerDictionary& operator=(const SkPdfFDFTrailerDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfFieldDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFieldDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFieldDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFieldDictionary_autogen.h
index 4ae49fb..6a67ff4 100644
--- a/experimental/PdfViewer/SkPdfFieldDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFieldDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFieldDictionary
 #define __DEFINED__SkPdfFieldDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFieldDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFieldDictionary(const SkPdfFieldDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFieldDictionary& operator=(const SkPdfFieldDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -568,11 +571,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Kids", "", NULL));
   }
 
-  SkPdfArray Kids() const {
-    SkPdfArray ret;
+  SkPdfArray* Kids() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Kids", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) The partial field name (see "Field Names," below; see also imple-
diff --git a/experimental/PdfViewer/SkPdfFileAttachmentAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFileAttachmentAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFileAttachmentAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFileAttachmentAnnotationDictionary_autogen.h
index d0e08cd..2187f76 100644
--- a/experimental/PdfViewer/SkPdfFileAttachmentAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFileAttachmentAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFileAttachmentAnnotationDictionary
 #define __DEFINED__SkPdfFileAttachmentAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFileAttachmentAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFileAttachmentAnnotationDictionary(const SkPdfFileAttachmentAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFileAttachmentAnnotationDictionary& operator=(const SkPdfFileAttachmentAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfFileSpecificationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFileSpecificationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFileSpecificationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFileSpecificationDictionary_autogen.h
index c2e8a05..d233724 100644
--- a/experimental/PdfViewer/SkPdfFileSpecificationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFileSpecificationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFileSpecificationDictionary
 #define __DEFINED__SkPdfFileSpecificationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFileSpecificationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFileSpecificationDictionary(const SkPdfFileSpecificationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFileSpecificationDictionary& operator=(const SkPdfFileSpecificationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -621,11 +624,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", NULL));
   }
 
-  SkPdfArray ID() const {
-    SkPdfArray ret;
+  SkPdfArray* ID() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.2) A flag indicating whether the file referenced by the file specifica-
diff --git a/experimental/PdfViewer/SkPdfFileTrailerDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFileTrailerDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFileTrailerDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFileTrailerDictionary_autogen.h
index 81d6cb9..4978695 100644
--- a/experimental/PdfViewer/SkPdfFileTrailerDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFileTrailerDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFileTrailerDictionary
 #define __DEFINED__SkPdfFileTrailerDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFileTrailerDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFileTrailerDictionary(const SkPdfFileTrailerDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFileTrailerDictionary& operator=(const SkPdfFileTrailerDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -600,11 +603,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", NULL));
   }
 
-  SkPdfArray ID() const {
-    SkPdfArray ret;
+  SkPdfArray* ID() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfFontDescriptorDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFontDescriptorDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFontDescriptorDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFontDescriptorDictionary_autogen.h
index 9e62f48..2d57f71 100644
--- a/experimental/PdfViewer/SkPdfFontDescriptorDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFontDescriptorDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFontDescriptorDictionary
 #define __DEFINED__SkPdfFontDescriptorDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -165,9 +166,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -177,6 +175,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFontDescriptorDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFontDescriptorDictionary(const SkPdfFontDescriptorDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFontDescriptorDictionary& operator=(const SkPdfFontDescriptorDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -574,11 +577,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontBBox", "", NULL));
   }
 
-  SkRect FontBBox() const {
-    SkRect ret;
+  SkRect* FontBBox() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontBBox", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Required) The angle, expressed in degrees counterclockwise from the verti-
diff --git a/experimental/PdfViewer/SkPdfFontDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFontDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFontDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFontDictionary_autogen.h
index a288a1f..818fc98 100644
--- a/experimental/PdfViewer/SkPdfFontDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFontDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFontDictionary
 #define __DEFINED__SkPdfFontDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -499,6 +500,8 @@
 public:
   SkPdfFontDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFontDictionary(const SkPdfFontDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFontDictionary& operator=(const SkPdfFontDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfFormFieldActionsDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFormFieldActionsDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFormFieldActionsDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFormFieldActionsDictionary_autogen.h
index 51b7945..2792bf1 100644
--- a/experimental/PdfViewer/SkPdfFormFieldActionsDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFormFieldActionsDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFormFieldActionsDictionary
 #define __DEFINED__SkPdfFormFieldActionsDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFreeTextAnnotationDictionary* asFreeTextAnnotationDictionary() {return NULL;}
   virtual const SkPdfFreeTextAnnotationDictionary* asFreeTextAnnotationDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFormFieldActionsDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFormFieldActionsDictionary(const SkPdfFormFieldActionsDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFormFieldActionsDictionary& operator=(const SkPdfFormFieldActionsDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfFreeTextAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFreeTextAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfFreeTextAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFreeTextAnnotationDictionary_autogen.h
index 22aa69f..795e9bf 100644
--- a/experimental/PdfViewer/SkPdfFreeTextAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFreeTextAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFreeTextAnnotationDictionary
 #define __DEFINED__SkPdfFreeTextAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFreeTextAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFreeTextAnnotationDictionary(const SkPdfFreeTextAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFreeTextAnnotationDictionary& operator=(const SkPdfFreeTextAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfFunctionCommonDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfFunctionCommonDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfFunctionCommonDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfFunctionCommonDictionary_autogen.h
index d1788aa..5633dcb 100644
--- a/experimental/PdfViewer/SkPdfFunctionCommonDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfFunctionCommonDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfFunctionCommonDictionary
 #define __DEFINED__SkPdfFunctionCommonDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfFunctionCommonDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfFunctionCommonDictionary(const SkPdfFunctionCommonDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfFunctionCommonDictionary& operator=(const SkPdfFunctionCommonDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -549,11 +552,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "", NULL));
   }
 
-  SkPdfArray Domain() const {
-    SkPdfArray ret;
+  SkPdfArray* Domain() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required for type 0 and type 4 functions, optional otherwise; see below) An
@@ -567,11 +570,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Range", "", NULL));
   }
 
-  SkPdfArray Range() const {
-    SkPdfArray ret;
+  SkPdfArray* Range() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Range", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfGoToActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfGoToActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfGoToActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfGoToActionDictionary_autogen.h
index 62216e1..2e04730 100644
--- a/experimental/PdfViewer/SkPdfGoToActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfGoToActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfGoToActionDictionary
 #define __DEFINED__SkPdfGoToActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfGoToActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfGoToActionDictionary(const SkPdfGoToActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfGoToActionDictionary& operator=(const SkPdfGoToActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -574,11 +577,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getDAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getDAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfGraphicsStateDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfGraphicsStateDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfGraphicsStateDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfGraphicsStateDictionary_autogen.h
index 209551c..7cb5f01 100644
--- a/experimental/PdfViewer/SkPdfGraphicsStateDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfGraphicsStateDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfGraphicsStateDictionary
 #define __DEFINED__SkPdfGraphicsStateDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfGraphicsStateDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfGraphicsStateDictionary(const SkPdfGraphicsStateDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfGraphicsStateDictionary& operator=(const SkPdfGraphicsStateDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -596,11 +599,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", NULL));
   }
 
-  SkPdfArray D() const {
-    SkPdfArray ret;
+  SkPdfArray* D() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.3) The name of the rendering intent (see "Rendering
@@ -675,11 +678,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Font", "", NULL));
   }
 
-  SkPdfArray Font() const {
-    SkPdfArray ret;
+  SkPdfArray* Font() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Font", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) The black-generation function, which maps the interval [0.0 1.0]
@@ -811,11 +814,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getTRAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getTRAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
   bool isTRAName() const {
@@ -859,11 +862,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getTR2AsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getTR2AsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TR2", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
   bool isTR2AName() const {
@@ -995,11 +998,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getBMAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getBMAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BM", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.4) The current soft mask, specifying the mask shape or
diff --git a/experimental/PdfViewer/SkPdfGroupAttributesDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfGroupAttributesDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfGroupAttributesDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfGroupAttributesDictionary_autogen.h
index 915752a..7ac962b 100644
--- a/experimental/PdfViewer/SkPdfGroupAttributesDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfGroupAttributesDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfGroupAttributesDictionary
 #define __DEFINED__SkPdfGroupAttributesDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfGroupAttributesDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfGroupAttributesDictionary(const SkPdfGroupAttributesDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfGroupAttributesDictionary& operator=(const SkPdfGroupAttributesDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfHeaders_autogen.h b/experimental/PdfViewer/autogen/SkPdfHeaders_autogen.h
similarity index 100%
rename from experimental/PdfViewer/SkPdfHeaders_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfHeaders_autogen.h
diff --git a/experimental/PdfViewer/SkPdfHexString_autogen.h b/experimental/PdfViewer/autogen/SkPdfHexString_autogen.h
similarity index 89%
rename from experimental/PdfViewer/SkPdfHexString_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfHexString_autogen.h
index 5792941..f8c0ee0 100644
--- a/experimental/PdfViewer/SkPdfHexString_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfHexString_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfHexString
 #define __DEFINED__SkPdfHexString
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfString_autogen.h"
@@ -20,6 +21,8 @@
 public:
   SkPdfHexString(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfString(podofoDoc, podofoObj) {}
 
+  SkPdfHexString(const SkPdfHexString& from) : SkPdfString(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfHexString& operator=(const SkPdfHexString& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfHideActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfHideActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfHideActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfHideActionDictionary_autogen.h
index 3cb56a5..e7a97fd 100644
--- a/experimental/PdfViewer/SkPdfHideActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfHideActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfHideActionDictionary
 #define __DEFINED__SkPdfHideActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfHideActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfHideActionDictionary(const SkPdfHideActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfHideActionDictionary& operator=(const SkPdfHideActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -580,11 +583,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getTAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getTAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "T", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A flag indicating whether to hide the annotation (true) or show it (false).
diff --git a/experimental/PdfViewer/SkPdfIccProfileStreamDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfIccProfileStreamDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfIccProfileStreamDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfIccProfileStreamDictionary_autogen.h
index 32ec6b8..565cb34 100644
--- a/experimental/PdfViewer/SkPdfIccProfileStreamDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfIccProfileStreamDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfIccProfileStreamDictionary
 #define __DEFINED__SkPdfIccProfileStreamDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfIccProfileStreamDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfIccProfileStreamDictionary(const SkPdfIccProfileStreamDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfIccProfileStreamDictionary& operator=(const SkPdfIccProfileStreamDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -559,11 +562,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getAlternateAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getAlternateAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alternate", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
   bool isAlternateAName() const {
@@ -588,11 +591,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Range", "", NULL));
   }
 
-  SkPdfArray Range() const {
-    SkPdfArray ret;
+  SkPdfArray* Range() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Range", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.4) A metadata stream containing metadata for the color space (see
diff --git a/experimental/PdfViewer/SkPdfIconFitDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfIconFitDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfIconFitDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfIconFitDictionary_autogen.h
index 371f673..60f7889 100644
--- a/experimental/PdfViewer/SkPdfIconFitDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfIconFitDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfIconFitDictionary
 #define __DEFINED__SkPdfIconFitDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfIconFitDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfIconFitDictionary(const SkPdfIconFitDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfIconFitDictionary& operator=(const SkPdfIconFitDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -571,11 +574,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "", NULL));
   }
 
-  SkPdfArray A() const {
-    SkPdfArray ret;
+  SkPdfArray* A() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfImageDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfImageDictionary_autogen.h
similarity index 96%
rename from experimental/PdfViewer/SkPdfImageDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfImageDictionary_autogen.h
index 209d121..c46cf5f 100644
--- a/experimental/PdfViewer/SkPdfImageDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfImageDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfImageDictionary
 #define __DEFINED__SkPdfImageDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfXObjectDictionary_autogen.h"
@@ -23,6 +24,8 @@
 public:
   SkPdfImageDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfXObjectDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfImageDictionary(const SkPdfImageDictionary& from) : SkPdfXObjectDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfImageDictionary& operator=(const SkPdfImageDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -108,11 +111,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getColorSpaceAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getColorSpaceAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpace", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required except for image masks; optional for image masks) The number of
@@ -200,11 +203,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getMaskAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getMaskAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Mask", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.4) A subsidiary image XObject defining a soft-mask
@@ -240,11 +243,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "", NULL));
   }
 
-  SkPdfArray Decode() const {
-    SkPdfArray ret;
+  SkPdfArray* Decode() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A flag indicating whether image interpolation is to be per-
@@ -270,11 +273,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alternates", "", NULL));
   }
 
-  SkPdfArray Alternates() const {
-    SkPdfArray ret;
+  SkPdfArray* Alternates() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Alternates", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required in PDF 1.0; optional otherwise) The name by which this image
diff --git a/experimental/PdfViewer/SkPdfImportDataActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfImportDataActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfImportDataActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfImportDataActionDictionary_autogen.h
index 96f307d..896dd6b 100644
--- a/experimental/PdfViewer/SkPdfImportDataActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfImportDataActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfImportDataActionDictionary
 #define __DEFINED__SkPdfImportDataActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfImportDataActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfImportDataActionDictionary(const SkPdfImportDataActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfImportDataActionDictionary& operator=(const SkPdfImportDataActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfInkAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfInkAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfInkAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfInkAnnotationDictionary_autogen.h
index fc8f72c..7347299 100644
--- a/experimental/PdfViewer/SkPdfInkAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfInkAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfInkAnnotationDictionary
 #define __DEFINED__SkPdfInkAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfInkAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfInkAnnotationDictionary(const SkPdfInkAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfInkAnnotationDictionary& operator=(const SkPdfInkAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -560,11 +563,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "InkList", "", NULL));
   }
 
-  SkPdfArray InkList() const {
-    SkPdfArray ret;
+  SkPdfArray* InkList() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "InkList", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A border style dictionary (see Table 8.12 on page 495) specifying the
diff --git a/experimental/PdfViewer/SkPdfInlineLevelStructureElementsDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfInlineLevelStructureElementsDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfInlineLevelStructureElementsDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfInlineLevelStructureElementsDictionary_autogen.h
index bc10fd5..1c8a9bd 100644
--- a/experimental/PdfViewer/SkPdfInlineLevelStructureElementsDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfInlineLevelStructureElementsDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfInlineLevelStructureElementsDictionary
 #define __DEFINED__SkPdfInlineLevelStructureElementsDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfInlineLevelStructureElementsDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfInlineLevelStructureElementsDictionary(const SkPdfInlineLevelStructureElementsDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfInlineLevelStructureElementsDictionary& operator=(const SkPdfInlineLevelStructureElementsDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfInteger_autogen.h b/experimental/PdfViewer/autogen/SkPdfInteger_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfInteger_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfInteger_autogen.h
index 624e1b8..3717140 100644
--- a/experimental/PdfViewer/SkPdfInteger_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfInteger_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfInteger
 #define __DEFINED__SkPdfInteger
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfObject_autogen.h"
@@ -176,9 +177,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -188,6 +186,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -548,6 +549,8 @@
 public:
   SkPdfInteger(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfObject(podofoDoc, podofoObj) {}
 
+  SkPdfInteger(const SkPdfInteger& from) : SkPdfObject(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfInteger& operator=(const SkPdfInteger& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfInteractiveFormDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfInteractiveFormDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfInteractiveFormDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfInteractiveFormDictionary_autogen.h
index 180bb3f..2837857 100644
--- a/experimental/PdfViewer/SkPdfInteractiveFormDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfInteractiveFormDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfInteractiveFormDictionary
 #define __DEFINED__SkPdfInteractiveFormDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfInteractiveFormDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfInteractiveFormDictionary(const SkPdfInteractiveFormDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfInteractiveFormDictionary& operator=(const SkPdfInteractiveFormDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -529,11 +532,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Fields", "", NULL));
   }
 
-  SkPdfArray Fields() const {
-    SkPdfArray ret;
+  SkPdfArray* Fields() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Fields", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A flag specifying whether to construct appearance streams and
@@ -576,11 +579,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CO", "", NULL));
   }
 
-  SkPdfArray CO() const {
-    SkPdfArray ret;
+  SkPdfArray* CO() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CO", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A document-wide default value for the DR attribute of variable
diff --git a/experimental/PdfViewer/SkPdfJavascriptActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfJavascriptActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfJavascriptActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfJavascriptActionDictionary_autogen.h
index 91fe460..fdac070 100644
--- a/experimental/PdfViewer/SkPdfJavascriptActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfJavascriptActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfJavascriptActionDictionary
 #define __DEFINED__SkPdfJavascriptActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfJavascriptActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfJavascriptActionDictionary(const SkPdfJavascriptActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfJavascriptActionDictionary& operator=(const SkPdfJavascriptActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfJavascriptDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfJavascriptDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfJavascriptDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfJavascriptDictionary_autogen.h
index 2e4892d..4a1ee00 100644
--- a/experimental/PdfViewer/SkPdfJavascriptDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfJavascriptDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfJavascriptDictionary
 #define __DEFINED__SkPdfJavascriptDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfJavascriptDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfJavascriptDictionary(const SkPdfJavascriptDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfJavascriptDictionary& operator=(const SkPdfJavascriptDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -602,11 +605,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Doc", "", NULL));
   }
 
-  SkPdfArray Doc() const {
-    SkPdfArray ret;
+  SkPdfArray* Doc() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Doc", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfJbig2DecodeFilterDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfJbig2DecodeFilterDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfJbig2DecodeFilterDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfJbig2DecodeFilterDictionary_autogen.h
index 6adfae8..2f457fb 100644
--- a/experimental/PdfViewer/SkPdfJbig2DecodeFilterDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfJbig2DecodeFilterDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfJbig2DecodeFilterDictionary
 #define __DEFINED__SkPdfJbig2DecodeFilterDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfJbig2DecodeFilterDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfJbig2DecodeFilterDictionary(const SkPdfJbig2DecodeFilterDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfJbig2DecodeFilterDictionary& operator=(const SkPdfJbig2DecodeFilterDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfLabColorSpaceDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfLabColorSpaceDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfLabColorSpaceDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfLabColorSpaceDictionary_autogen.h
index 57cc98d..52fb023 100644
--- a/experimental/PdfViewer/SkPdfLabColorSpaceDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfLabColorSpaceDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfLabColorSpaceDictionary
 #define __DEFINED__SkPdfLabColorSpaceDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfLabColorSpaceDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfLabColorSpaceDictionary(const SkPdfLabColorSpaceDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfLabColorSpaceDictionary& operator=(const SkPdfLabColorSpaceDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -531,11 +534,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "WhitePoint", "", NULL));
   }
 
-  SkPdfArray WhitePoint() const {
-    SkPdfArray ret;
+  SkPdfArray* WhitePoint() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "WhitePoint", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of three numbers [ XB YB ZB ] specifying the tristimulus value, in
@@ -547,11 +550,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BlackPoint", "", NULL));
   }
 
-  SkPdfArray BlackPoint() const {
-    SkPdfArray ret;
+  SkPdfArray* BlackPoint() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BlackPoint", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of four numbers [ amin amax bmin bmax ] specifying the range of
@@ -566,11 +569,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Range", "", NULL));
   }
 
-  SkPdfArray Range() const {
-    SkPdfArray ret;
+  SkPdfArray* Range() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Range", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfLaunchActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfLaunchActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfLaunchActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfLaunchActionDictionary_autogen.h
index 1a373cc..5fbb763 100644
--- a/experimental/PdfViewer/SkPdfLaunchActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfLaunchActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfLaunchActionDictionary
 #define __DEFINED__SkPdfLaunchActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfLaunchActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfLaunchActionDictionary(const SkPdfLaunchActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfLaunchActionDictionary& operator=(const SkPdfLaunchActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfLineAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfLineAnnotationDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfLineAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfLineAnnotationDictionary_autogen.h
index 94777ba..29f5758 100644
--- a/experimental/PdfViewer/SkPdfLineAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfLineAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfLineAnnotationDictionary
 #define __DEFINED__SkPdfLineAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfLineAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfLineAnnotationDictionary(const SkPdfLineAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfLineAnnotationDictionary& operator=(const SkPdfLineAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -557,11 +560,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "L", "", NULL));
   }
 
-  SkPdfArray L() const {
-    SkPdfArray ret;
+  SkPdfArray* L() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "L", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A border style dictionary (see Table 8.12 on page 495) specifying the
@@ -590,11 +593,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LE", "", NULL));
   }
 
-  SkPdfArray LE() const {
-    SkPdfArray ret;
+  SkPdfArray* LE() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LE", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.4) An array of three numbers in the range 0.0 to 1.0 specifying
@@ -606,11 +609,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IC", "", NULL));
   }
 
-  SkPdfArray IC() const {
-    SkPdfArray ret;
+  SkPdfArray* IC() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IC", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfListAttributeDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfListAttributeDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfListAttributeDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfListAttributeDictionary_autogen.h
index 7dee031..8b8bbe3 100644
--- a/experimental/PdfViewer/SkPdfListAttributeDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfListAttributeDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfListAttributeDictionary
 #define __DEFINED__SkPdfListAttributeDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfListAttributeDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfListAttributeDictionary(const SkPdfListAttributeDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfListAttributeDictionary& operator=(const SkPdfListAttributeDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfLzwdecodeAndFlatedecodeFiltersDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfLzwdecodeAndFlatedecodeFiltersDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfLzwdecodeAndFlatedecodeFiltersDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfLzwdecodeAndFlatedecodeFiltersDictionary_autogen.h
index 3a04693..eb43ba2 100644
--- a/experimental/PdfViewer/SkPdfLzwdecodeAndFlatedecodeFiltersDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfLzwdecodeAndFlatedecodeFiltersDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfLzwdecodeAndFlatedecodeFiltersDictionary
 #define __DEFINED__SkPdfLzwdecodeAndFlatedecodeFiltersDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfLzwdecodeAndFlatedecodeFiltersDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfLzwdecodeAndFlatedecodeFiltersDictionary(const SkPdfLzwdecodeAndFlatedecodeFiltersDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfLzwdecodeAndFlatedecodeFiltersDictionary& operator=(const SkPdfLzwdecodeAndFlatedecodeFiltersDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfMacOsFileInformationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfMacOsFileInformationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfMacOsFileInformationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfMacOsFileInformationDictionary_autogen.h
index 4d58b49..5e070c8 100644
--- a/experimental/PdfViewer/SkPdfMacOsFileInformationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfMacOsFileInformationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfMacOsFileInformationDictionary
 #define __DEFINED__SkPdfMacOsFileInformationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfMacOsFileInformationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfMacOsFileInformationDictionary(const SkPdfMacOsFileInformationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfMacOsFileInformationDictionary& operator=(const SkPdfMacOsFileInformationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfMarkInformationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfMarkInformationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfMarkInformationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfMarkInformationDictionary_autogen.h
index 468f26b..c88d491 100644
--- a/experimental/PdfViewer/SkPdfMarkInformationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfMarkInformationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfMarkInformationDictionary
 #define __DEFINED__SkPdfMarkInformationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfMarkInformationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfMarkInformationDictionary(const SkPdfMarkInformationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfMarkInformationDictionary& operator=(const SkPdfMarkInformationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfMarkedContentReferenceDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfMarkedContentReferenceDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfMarkedContentReferenceDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfMarkedContentReferenceDictionary_autogen.h
index 8dcc349..bf0f64f 100644
--- a/experimental/PdfViewer/SkPdfMarkedContentReferenceDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfMarkedContentReferenceDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfMarkedContentReferenceDictionary
 #define __DEFINED__SkPdfMarkedContentReferenceDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfMarkedContentReferenceDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfMarkedContentReferenceDictionary(const SkPdfMarkedContentReferenceDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfMarkedContentReferenceDictionary& operator=(const SkPdfMarkedContentReferenceDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfMarkupAnnotationsDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfMarkupAnnotationsDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfMarkupAnnotationsDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfMarkupAnnotationsDictionary_autogen.h
index 711fad4..dc754b2 100644
--- a/experimental/PdfViewer/SkPdfMarkupAnnotationsDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfMarkupAnnotationsDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfMarkupAnnotationsDictionary
 #define __DEFINED__SkPdfMarkupAnnotationsDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfMarkupAnnotationsDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfMarkupAnnotationsDictionary(const SkPdfMarkupAnnotationsDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfMarkupAnnotationsDictionary& operator=(const SkPdfMarkupAnnotationsDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -576,11 +579,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "QuadPoints", "", NULL));
   }
 
-  SkPdfArray QuadPoints() const {
-    SkPdfArray ret;
+  SkPdfArray* QuadPoints() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "QuadPoints", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfMetadataStreamDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfMetadataStreamDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfMetadataStreamDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfMetadataStreamDictionary_autogen.h
index d5faf30..0c8798f 100644
--- a/experimental/PdfViewer/SkPdfMetadataStreamDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfMetadataStreamDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfMetadataStreamDictionary
 #define __DEFINED__SkPdfMetadataStreamDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfMetadataStreamDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfMetadataStreamDictionary(const SkPdfMetadataStreamDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfMetadataStreamDictionary& operator=(const SkPdfMetadataStreamDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfMovieActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfMovieActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfMovieActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfMovieActionDictionary_autogen.h
index d307c1b..2b2e193 100644
--- a/experimental/PdfViewer/SkPdfMovieActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfMovieActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfMovieActionDictionary
 #define __DEFINED__SkPdfMovieActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfMovieActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfMovieActionDictionary(const SkPdfMovieActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfMovieActionDictionary& operator=(const SkPdfMovieActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfMovieActivationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfMovieActivationDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfMovieActivationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfMovieActivationDictionary_autogen.h
index 608c821..88fe52b 100644
--- a/experimental/PdfViewer/SkPdfMovieActivationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfMovieActivationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfMovieActivationDictionary
 #define __DEFINED__SkPdfMovieActivationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfMovieActivationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfMovieActivationDictionary(const SkPdfMovieActivationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfMovieActivationDictionary& operator=(const SkPdfMovieActivationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -655,11 +658,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FWScale", "", NULL));
   }
 
-  SkPdfArray FWScale() const {
-    SkPdfArray ret;
+  SkPdfArray* FWScale() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FWScale", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) For floating play windows, the relative position of the window on
@@ -674,11 +677,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FWPosition", "", NULL));
   }
 
-  SkPdfArray FWPosition() const {
-    SkPdfArray ret;
+  SkPdfArray* FWPosition() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FWPosition", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfMovieAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfMovieAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfMovieAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfMovieAnnotationDictionary_autogen.h
index 725b1fa..db13412 100644
--- a/experimental/PdfViewer/SkPdfMovieAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfMovieAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfMovieAnnotationDictionary
 #define __DEFINED__SkPdfMovieAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfMovieAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfMovieAnnotationDictionary(const SkPdfMovieAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfMovieAnnotationDictionary& operator=(const SkPdfMovieAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfMovieDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfMovieDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfMovieDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfMovieDictionary_autogen.h
index 59bf5e0..9173414 100644
--- a/experimental/PdfViewer/SkPdfMovieDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfMovieDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfMovieDictionary
 #define __DEFINED__SkPdfMovieDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfMovieDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfMovieDictionary(const SkPdfMovieDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfMovieDictionary& operator=(const SkPdfMovieDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -545,11 +548,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Aspect", "", NULL));
   }
 
-  SkPdfArray Aspect() const {
-    SkPdfArray ret;
+  SkPdfArray* Aspect() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Aspect", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) The number of degrees by which the movie is rotated clockwise
diff --git a/experimental/PdfViewer/SkPdfMultiMasterFontDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfMultiMasterFontDictionary_autogen.h
similarity index 83%
rename from experimental/PdfViewer/SkPdfMultiMasterFontDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfMultiMasterFontDictionary_autogen.h
index 3a9fc91..766cf06 100644
--- a/experimental/PdfViewer/SkPdfMultiMasterFontDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfMultiMasterFontDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfMultiMasterFontDictionary
 #define __DEFINED__SkPdfMultiMasterFontDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfType1FontDictionary_autogen.h"
@@ -17,11 +18,16 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
 public:
 private:
 public:
   SkPdfMultiMasterFontDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfType1FontDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfMultiMasterFontDictionary(const SkPdfMultiMasterFontDictionary& from) : SkPdfType1FontDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfMultiMasterFontDictionary& operator=(const SkPdfMultiMasterFontDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfNameDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfNameDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfNameDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfNameDictionary_autogen.h
index 0c517aa..2e1e824 100644
--- a/experimental/PdfViewer/SkPdfNameDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfNameDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfNameDictionary
 #define __DEFINED__SkPdfNameDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfNameDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfNameDictionary(const SkPdfNameDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfNameDictionary& operator=(const SkPdfNameDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfNameTreeNodeDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfNameTreeNodeDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfNameTreeNodeDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfNameTreeNodeDictionary_autogen.h
index 8c807f2..6a9afd4 100644
--- a/experimental/PdfViewer/SkPdfNameTreeNodeDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfNameTreeNodeDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfNameTreeNodeDictionary
 #define __DEFINED__SkPdfNameTreeNodeDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfNameTreeNodeDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfNameTreeNodeDictionary(const SkPdfNameTreeNodeDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfNameTreeNodeDictionary& operator=(const SkPdfNameTreeNodeDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -530,11 +533,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Kids", "", NULL));
   }
 
-  SkPdfArray Kids() const {
-    SkPdfArray ret;
+  SkPdfArray* Kids() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Kids", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Root and leaf nodes only; required in leaf nodes; present in the root node if and only if Kids
@@ -547,11 +550,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Names", "", NULL));
   }
 
-  SkPdfArray Names() const {
-    SkPdfArray ret;
+  SkPdfArray* Names() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Names", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Intermediate and leaf nodes only; required) An array of two strings, specifying the (lexi-
@@ -562,11 +565,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Limits", "", NULL));
   }
 
-  SkPdfArray Limits() const {
-    SkPdfArray ret;
+  SkPdfArray* Limits() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Limits", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfName_autogen.h b/experimental/PdfViewer/autogen/SkPdfName_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfName_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfName_autogen.h
index 6d23ce4..e3be4a0 100644
--- a/experimental/PdfViewer/SkPdfName_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfName_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfName
 #define __DEFINED__SkPdfName
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfObject_autogen.h"
@@ -176,9 +177,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -188,6 +186,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -551,6 +552,8 @@
 public:
   SkPdfName(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfObject(podofoDoc, podofoObj) {}
 
+  SkPdfName(const SkPdfName& from) : SkPdfObject(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfName& operator=(const SkPdfName& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfNamedActionsDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfNamedActionsDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfNamedActionsDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfNamedActionsDictionary_autogen.h
index 26043a5..8545683 100644
--- a/experimental/PdfViewer/SkPdfNamedActionsDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfNamedActionsDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfNamedActionsDictionary
 #define __DEFINED__SkPdfNamedActionsDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfNamedActionsDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfNamedActionsDictionary(const SkPdfNamedActionsDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfNamedActionsDictionary& operator=(const SkPdfNamedActionsDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfNull_autogen.h b/experimental/PdfViewer/autogen/SkPdfNull_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfNull_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfNull_autogen.h
index cb90aff..9b54eee 100644
--- a/experimental/PdfViewer/SkPdfNull_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfNull_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfNull
 #define __DEFINED__SkPdfNull
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfObject_autogen.h"
@@ -176,9 +177,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -188,6 +186,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -550,6 +551,8 @@
 public:
   SkPdfNull(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfObject(podofoDoc, podofoObj) {}
 
+  SkPdfNull(const SkPdfNull& from) : SkPdfObject(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfNull& operator=(const SkPdfNull& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfNumberTreeNodeDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfNumberTreeNodeDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfNumberTreeNodeDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfNumberTreeNodeDictionary_autogen.h
index bc24b3f..3cce6af 100644
--- a/experimental/PdfViewer/SkPdfNumberTreeNodeDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfNumberTreeNodeDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfNumberTreeNodeDictionary
 #define __DEFINED__SkPdfNumberTreeNodeDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfNumberTreeNodeDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfNumberTreeNodeDictionary(const SkPdfNumberTreeNodeDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfNumberTreeNodeDictionary& operator=(const SkPdfNumberTreeNodeDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -530,11 +533,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Kids", "", NULL));
   }
 
-  SkPdfArray Kids() const {
-    SkPdfArray ret;
+  SkPdfArray* Kids() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Kids", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Root and leaf nodes only; required in leaf nodes; present in the root node if and only if Kids
@@ -548,11 +551,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Nums", "", NULL));
   }
 
-  SkPdfArray Nums() const {
-    SkPdfArray ret;
+  SkPdfArray* Nums() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Nums", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Intermediate and leaf nodes only; required) An array of two integers, specifying the
@@ -563,11 +566,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Limits", "", NULL));
   }
 
-  SkPdfArray Limits() const {
-    SkPdfArray ret;
+  SkPdfArray* Limits() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Limits", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfNumber_autogen.h b/experimental/PdfViewer/autogen/SkPdfNumber_autogen.h
similarity index 88%
rename from experimental/PdfViewer/SkPdfNumber_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfNumber_autogen.h
index 68ae135..a0c171d 100644
--- a/experimental/PdfViewer/SkPdfNumber_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfNumber_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfNumber
 #define __DEFINED__SkPdfNumber
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfInteger_autogen.h"
@@ -20,6 +21,8 @@
 public:
   SkPdfNumber(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfInteger(podofoDoc, podofoObj) {}
 
+  SkPdfNumber(const SkPdfNumber& from) : SkPdfInteger(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfNumber& operator=(const SkPdfNumber& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfObjectReferenceDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfObjectReferenceDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfObjectReferenceDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfObjectReferenceDictionary_autogen.h
index 57fc29d..f6cff49 100644
--- a/experimental/PdfViewer/SkPdfObjectReferenceDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfObjectReferenceDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfObjectReferenceDictionary
 #define __DEFINED__SkPdfObjectReferenceDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfObjectReferenceDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfObjectReferenceDictionary(const SkPdfObjectReferenceDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfObjectReferenceDictionary& operator=(const SkPdfObjectReferenceDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfObject_autogen.h b/experimental/PdfViewer/autogen/SkPdfObject_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfObject_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfObject_autogen.h
index 8d9c0a1..83cd5ca 100644
--- a/experimental/PdfViewer/SkPdfObject_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfObject_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfObject
 #define __DEFINED__SkPdfObject
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 
@@ -174,9 +175,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -186,6 +184,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -554,6 +555,8 @@
 
 public:
   SkPdfObject(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : fPodofoDoc(podofoDoc), fPodofoObj(podofoObj) {}
+  SkPdfObject(const SkPdfObject& from) : fPodofoDoc(from.fPodofoDoc), fPodofoObj(from.fPodofoObj) {}
+
   const PdfMemDocument* doc() const { return fPodofoDoc;}
   const PdfObject* podofo() const { return fPodofoObj;}
   virtual bool valid() const {return true;}
diff --git a/experimental/PdfViewer/SkPdfOpiVersionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfOpiVersionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfOpiVersionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfOpiVersionDictionary_autogen.h
index 38281ac..7da516a 100644
--- a/experimental/PdfViewer/SkPdfOpiVersionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfOpiVersionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfOpiVersionDictionary
 #define __DEFINED__SkPdfOpiVersionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfOpiVersionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfOpiVersionDictionary(const SkPdfOpiVersionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfOpiVersionDictionary& operator=(const SkPdfOpiVersionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfOutlineDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfOutlineDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfOutlineDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfOutlineDictionary_autogen.h
index e25b088..55a13c0 100644
--- a/experimental/PdfViewer/SkPdfOutlineDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfOutlineDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfOutlineDictionary
 #define __DEFINED__SkPdfOutlineDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfOutlineDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfOutlineDictionary(const SkPdfOutlineDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfOutlineDictionary& operator=(const SkPdfOutlineDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfOutlineItemDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfOutlineItemDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfOutlineItemDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfOutlineItemDictionary_autogen.h
index 46cfb8f..eb74f64 100644
--- a/experimental/PdfViewer/SkPdfOutlineItemDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfOutlineItemDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfOutlineItemDictionary
 #define __DEFINED__SkPdfOutlineItemDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfOutlineItemDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfOutlineItemDictionary(const SkPdfOutlineItemDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfOutlineItemDictionary& operator=(const SkPdfOutlineItemDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -661,11 +664,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getDestAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getDestAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.1; not permitted if a Dest entry is present) The action to be
@@ -709,11 +712,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", NULL));
   }
 
-  SkPdfArray C() const {
-    SkPdfArray ret;
+  SkPdfArray* C() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.4) A set of flags specifying style characteristics for display-
diff --git a/experimental/PdfViewer/SkPdfPDF_XOutputIntentDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfPDF_XOutputIntentDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfPDF_XOutputIntentDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfPDF_XOutputIntentDictionary_autogen.h
index cc310be..8b21fcf 100644
--- a/experimental/PdfViewer/SkPdfPDF_XOutputIntentDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfPDF_XOutputIntentDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfPDF_XOutputIntentDictionary
 #define __DEFINED__SkPdfPDF_XOutputIntentDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfPDF_XOutputIntentDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfPDF_XOutputIntentDictionary(const SkPdfPDF_XOutputIntentDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfPDF_XOutputIntentDictionary& operator=(const SkPdfPDF_XOutputIntentDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfPSXobjectDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfPSXobjectDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfPSXobjectDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfPSXobjectDictionary_autogen.h
index a194adb..a136f45 100644
--- a/experimental/PdfViewer/SkPdfPSXobjectDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfPSXobjectDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfPSXobjectDictionary
 #define __DEFINED__SkPdfPSXobjectDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfPSXobjectDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfPSXobjectDictionary(const SkPdfPSXobjectDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfPSXobjectDictionary& operator=(const SkPdfPSXobjectDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfPageLabelDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfPageLabelDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfPageLabelDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfPageLabelDictionary_autogen.h
index 3053a7d..dceaf55 100644
--- a/experimental/PdfViewer/SkPdfPageLabelDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfPageLabelDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfPageLabelDictionary
 #define __DEFINED__SkPdfPageLabelDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfPageLabelDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfPageLabelDictionary(const SkPdfPageLabelDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfPageLabelDictionary& operator=(const SkPdfPageLabelDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfPageObjectActionsDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfPageObjectActionsDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfPageObjectActionsDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfPageObjectActionsDictionary_autogen.h
index 527aa37..9a582ce 100644
--- a/experimental/PdfViewer/SkPdfPageObjectActionsDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfPageObjectActionsDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfPageObjectActionsDictionary
 #define __DEFINED__SkPdfPageObjectActionsDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfPageObjectActionsDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfPageObjectActionsDictionary(const SkPdfPageObjectActionsDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfPageObjectActionsDictionary& operator=(const SkPdfPageObjectActionsDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfPageObjectDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfPageObjectDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfPageObjectDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfPageObjectDictionary_autogen.h
index 54ba3db..46d686e 100644
--- a/experimental/PdfViewer/SkPdfPageObjectDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfPageObjectDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfPageObjectDictionary
 #define __DEFINED__SkPdfPageObjectDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfPageObjectDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfPageObjectDictionary(const SkPdfPageObjectDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfPageObjectDictionary& operator=(const SkPdfPageObjectDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -594,11 +597,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MediaBox", "", NULL));
   }
 
-  SkRect MediaBox() const {
-    SkRect ret;
+  SkRect* MediaBox() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MediaBox", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Optional; inheritable) A rectangle, expressed in default user space units,
@@ -612,11 +615,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CropBox", "", NULL));
   }
 
-  SkRect CropBox() const {
-    SkRect ret;
+  SkRect* CropBox() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CropBox", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de-
@@ -628,11 +631,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BleedBox", "", NULL));
   }
 
-  SkRect BleedBox() const {
-    SkRect ret;
+  SkRect* BleedBox() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BleedBox", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de-
@@ -643,11 +646,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TrimBox", "", NULL));
   }
 
-  SkRect TrimBox() const {
-    SkRect ret;
+  SkRect* TrimBox() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TrimBox", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de-
@@ -659,11 +662,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ArtBox", "", NULL));
   }
 
-  SkRect ArtBox() const {
-    SkRect ret;
+  SkRect* ArtBox() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ArtBox", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Optional) A box color information dictionary specifying the colors and
@@ -719,11 +722,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getContentsAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getContentsAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; inheritable) The number of degrees by which the page should
@@ -779,11 +782,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "", NULL));
   }
 
-  SkPdfArray B() const {
-    SkPdfArray ret;
+  SkPdfArray* B() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.1) The page's display duration (also called its advance
@@ -825,11 +828,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annots", "", NULL));
   }
 
-  SkPdfArray Annots() const {
-    SkPdfArray ret;
+  SkPdfArray* Annots() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annots", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.2) An additional-actions dictionary defining actions to
diff --git a/experimental/PdfViewer/SkPdfPagePieceDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfPagePieceDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfPagePieceDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfPagePieceDictionary_autogen.h
index 5a734b7..9ffd819 100644
--- a/experimental/PdfViewer/SkPdfPagePieceDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfPagePieceDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfPagePieceDictionary
 #define __DEFINED__SkPdfPagePieceDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfPagePieceDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfPagePieceDictionary(const SkPdfPagePieceDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfPagePieceDictionary& operator=(const SkPdfPagePieceDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfPageTreeNodeDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfPageTreeNodeDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfPageTreeNodeDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfPageTreeNodeDictionary_autogen.h
index 2395385..b1d6d7c 100644
--- a/experimental/PdfViewer/SkPdfPageTreeNodeDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfPageTreeNodeDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfPageTreeNodeDictionary
 #define __DEFINED__SkPdfPageTreeNodeDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfPageTreeNodeDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfPageTreeNodeDictionary(const SkPdfPageTreeNodeDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfPageTreeNodeDictionary& operator=(const SkPdfPageTreeNodeDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -557,11 +560,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Kids", "", NULL));
   }
 
-  SkPdfArray Kids() const {
-    SkPdfArray ret;
+  SkPdfArray* Kids() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Kids", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) The number of leaf nodes (page objects) that are descendants of this
diff --git a/experimental/PdfViewer/SkPdfPodofoMapper_autogen.h b/experimental/PdfViewer/autogen/SkPdfPodofoMapper_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfPodofoMapper_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfPodofoMapper_autogen.h
index e454686..f4c52b4 100644
--- a/experimental/PdfViewer/SkPdfPodofoMapper_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfPodofoMapper_autogen.h
@@ -896,6 +896,7 @@
 
     if (map(podofoDoc, podofoObj, (SkPdfMultiMasterFontDictionary**)out)) return true;
     if (map(podofoDoc, podofoObj, (SkPdfTrueTypeFontDictionary**)out)) return true;
+    if (map(podofoDoc, podofoObj, (SkPdfType3FontDictionary**)out)) return true;
 
     *out = new SkPdfType1FontDictionary(&podofoDoc, &podofoObj);
     return true;
@@ -968,7 +969,6 @@
   static bool map(const PdfMemDocument& podofoDoc, const PdfObject& podofoObj, SkPdfType0FontDictionary** out) {
     if (!isType0FontDictionary(podofoDoc, podofoObj)) return false;
 
-    if (map(podofoDoc, podofoObj, (SkPdfType3FontDictionary**)out)) return true;
 
     *out = new SkPdfType0FontDictionary(&podofoDoc, &podofoObj);
     return true;
@@ -2581,7 +2581,7 @@
   static bool isType1FontDictionary(const PdfMemDocument& podofoDoc, const PdfObject& podofoObj) {
     std::string Subtype;
     if (!NameFromDictionary(&podofoDoc, podofoObj.GetDictionary(), "Subtype", "", &Subtype)) return false;
-    if ((Subtype != "MMType1") && (Subtype != "TrueType") && (Subtype != "Type1")) return false;
+    if ((Subtype != "MMType1") && (Subtype != "TrueType") && (Subtype != "Type3") && (Subtype != "Type1")) return false;
 
     return true;
   }
@@ -2617,7 +2617,7 @@
   static bool isType0FontDictionary(const PdfMemDocument& podofoDoc, const PdfObject& podofoObj) {
     std::string Subtype;
     if (!NameFromDictionary(&podofoDoc, podofoObj.GetDictionary(), "Subtype", "", &Subtype)) return false;
-    if ((Subtype != "Type3") && (Subtype != "Type0")) return false;
+    if ((Subtype != "Type0")) return false;
 
     return true;
   }
diff --git a/experimental/PdfViewer/SkPdfPopUpAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfPopUpAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfPopUpAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfPopUpAnnotationDictionary_autogen.h
index 0352180..6c1e25f 100644
--- a/experimental/PdfViewer/SkPdfPopUpAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfPopUpAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfPopUpAnnotationDictionary
 #define __DEFINED__SkPdfPopUpAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfPopUpAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfPopUpAnnotationDictionary(const SkPdfPopUpAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfPopUpAnnotationDictionary& operator=(const SkPdfPopUpAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfPrinterMarkAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfPrinterMarkAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfPrinterMarkAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfPrinterMarkAnnotationDictionary_autogen.h
index 150c6c5..07f7ff0 100644
--- a/experimental/PdfViewer/SkPdfPrinterMarkAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfPrinterMarkAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfPrinterMarkAnnotationDictionary
 #define __DEFINED__SkPdfPrinterMarkAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfPrinterMarkAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfPrinterMarkAnnotationDictionary(const SkPdfPrinterMarkAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfPrinterMarkAnnotationDictionary& operator=(const SkPdfPrinterMarkAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfPrinterMarkFormDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfPrinterMarkFormDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfPrinterMarkFormDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfPrinterMarkFormDictionary_autogen.h
index 93fe3c7..1463783 100644
--- a/experimental/PdfViewer/SkPdfPrinterMarkFormDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfPrinterMarkFormDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfPrinterMarkFormDictionary
 #define __DEFINED__SkPdfPrinterMarkFormDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfPrinterMarkFormDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfPrinterMarkFormDictionary(const SkPdfPrinterMarkFormDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfPrinterMarkFormDictionary& operator=(const SkPdfPrinterMarkFormDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfRadioButtonFieldDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfRadioButtonFieldDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfRadioButtonFieldDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfRadioButtonFieldDictionary_autogen.h
index 67afa60..35851bd 100644
--- a/experimental/PdfViewer/SkPdfRadioButtonFieldDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfRadioButtonFieldDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfRadioButtonFieldDictionary
 #define __DEFINED__SkPdfRadioButtonFieldDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfRadioButtonFieldDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfRadioButtonFieldDictionary(const SkPdfRadioButtonFieldDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfRadioButtonFieldDictionary& operator=(const SkPdfRadioButtonFieldDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -532,11 +535,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Opt", "", NULL));
   }
 
-  SkPdfArray Opt() const {
-    SkPdfArray ret;
+  SkPdfArray* Opt() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Opt", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfReferenceDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfReferenceDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfReferenceDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfReferenceDictionary_autogen.h
index 4197670..dc4d679 100644
--- a/experimental/PdfViewer/SkPdfReferenceDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfReferenceDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfReferenceDictionary
 #define __DEFINED__SkPdfReferenceDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfReferenceDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfReferenceDictionary(const SkPdfReferenceDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfReferenceDictionary& operator=(const SkPdfReferenceDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -580,11 +583,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", NULL));
   }
 
-  SkPdfArray ID() const {
-    SkPdfArray ret;
+  SkPdfArray* ID() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfReference_autogen.h b/experimental/PdfViewer/autogen/SkPdfReference_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfReference_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfReference_autogen.h
index 2c3aa27..01d38c8 100644
--- a/experimental/PdfViewer/SkPdfReference_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfReference_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfReference
 #define __DEFINED__SkPdfReference
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfObject_autogen.h"
@@ -176,9 +177,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -188,6 +186,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -550,6 +551,8 @@
 public:
   SkPdfReference(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfObject(podofoDoc, podofoObj) {}
 
+  SkPdfReference(const SkPdfReference& from) : SkPdfObject(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfReference& operator=(const SkPdfReference& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfRemoteGoToActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfRemoteGoToActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfRemoteGoToActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfRemoteGoToActionDictionary_autogen.h
index b2f79f7..eb42612 100644
--- a/experimental/PdfViewer/SkPdfRemoteGoToActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfRemoteGoToActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfRemoteGoToActionDictionary
 #define __DEFINED__SkPdfRemoteGoToActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfRemoteGoToActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfRemoteGoToActionDictionary(const SkPdfRemoteGoToActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfRemoteGoToActionDictionary& operator=(const SkPdfRemoteGoToActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -591,11 +594,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getDAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getDAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.2) A flag specifying whether to open the destination docu-
diff --git a/experimental/PdfViewer/SkPdfResetFormActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfResetFormActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfResetFormActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfResetFormActionDictionary_autogen.h
index 4211da8..b4efb99 100644
--- a/experimental/PdfViewer/SkPdfResetFormActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfResetFormActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfResetFormActionDictionary
 #define __DEFINED__SkPdfResetFormActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfResetFormActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfResetFormActionDictionary(const SkPdfResetFormActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfResetFormActionDictionary& operator=(const SkPdfResetFormActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -549,11 +552,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Fields", "", NULL));
   }
 
-  SkPdfArray Fields() const {
-    SkPdfArray ret;
+  SkPdfArray* Fields() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Fields", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; inheritable) A set of flags specifying various characteristics of
diff --git a/experimental/PdfViewer/SkPdfResourceDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfResourceDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfResourceDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfResourceDictionary_autogen.h
index 94dd8a4..bd7079d 100644
--- a/experimental/PdfViewer/SkPdfResourceDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfResourceDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfResourceDictionary
 #define __DEFINED__SkPdfResourceDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfResourceDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfResourceDictionary(const SkPdfResourceDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfResourceDictionary& operator=(const SkPdfResourceDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -614,11 +617,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ProcSet", "", NULL));
   }
 
-  SkPdfArray ProcSet() const {
-    SkPdfArray ret;
+  SkPdfArray* ProcSet() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ProcSet", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.2) A dictionary mapping resource names to property list
diff --git a/experimental/PdfViewer/SkPdfRubberStampAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfRubberStampAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfRubberStampAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfRubberStampAnnotationDictionary_autogen.h
index 131d7bb..1d56702 100644
--- a/experimental/PdfViewer/SkPdfRubberStampAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfRubberStampAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfRubberStampAnnotationDictionary
 #define __DEFINED__SkPdfRubberStampAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfRubberStampAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfRubberStampAnnotationDictionary(const SkPdfRubberStampAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfRubberStampAnnotationDictionary& operator=(const SkPdfRubberStampAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfSeparationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfSeparationDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfSeparationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfSeparationDictionary_autogen.h
index 26d0301..1c48aba 100644
--- a/experimental/PdfViewer/SkPdfSeparationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfSeparationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfSeparationDictionary
 #define __DEFINED__SkPdfSeparationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfSeparationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfSeparationDictionary(const SkPdfSeparationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfSeparationDictionary& operator=(const SkPdfSeparationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -532,11 +535,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", "", NULL));
   }
 
-  SkPdfArray Pages() const {
-    SkPdfArray ret;
+  SkPdfArray* Pages() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) The name of the device colorant to be used in rendering this
@@ -587,11 +590,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpace", "", NULL));
   }
 
-  SkPdfArray ColorSpace() const {
-    SkPdfArray ret;
+  SkPdfArray* ColorSpace() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpace", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfShadingDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfShadingDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfShadingDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfShadingDictionary_autogen.h
index b843104..b859b46 100644
--- a/experimental/PdfViewer/SkPdfShadingDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfShadingDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfShadingDictionary
 #define __DEFINED__SkPdfShadingDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -500,6 +501,8 @@
 public:
   SkPdfShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfShadingDictionary(const SkPdfShadingDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfShadingDictionary& operator=(const SkPdfShadingDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -551,11 +554,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getColorSpaceAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getColorSpaceAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpace", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of color components appropriate to the color space,
@@ -572,11 +575,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Background", "", NULL));
   }
 
-  SkPdfArray Background() const {
-    SkPdfArray ret;
+  SkPdfArray* Background() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Background", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of four numbers giving the left, bottom, right, and top
@@ -590,11 +593,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BBox", "", NULL));
   }
 
-  SkRect BBox() const {
-    SkRect ret;
+  SkRect* BBox() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BBox", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Optional) A flag indicating whether to filter the shading function to prevent
diff --git a/experimental/PdfViewer/SkPdfSignatureDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfSignatureDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfSignatureDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfSignatureDictionary_autogen.h
index aaf9fe5..cdb249c 100644
--- a/experimental/PdfViewer/SkPdfSignatureDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfSignatureDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfSignatureDictionary
 #define __DEFINED__SkPdfSignatureDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfSignatureDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfSignatureDictionary(const SkPdfSignatureDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfSignatureDictionary& operator=(const SkPdfSignatureDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -573,11 +576,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ByteRange", "", NULL));
   }
 
-  SkPdfArray ByteRange() const {
-    SkPdfArray ret;
+  SkPdfArray* ByteRange() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ByteRange", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) The encrypted signature token.
diff --git a/experimental/PdfViewer/SkPdfSoftMaskDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfSoftMaskDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfSoftMaskDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfSoftMaskDictionary_autogen.h
index 59b011a..73295e0 100644
--- a/experimental/PdfViewer/SkPdfSoftMaskDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfSoftMaskDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfSoftMaskDictionary
 #define __DEFINED__SkPdfSoftMaskDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfSoftMaskDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfSoftMaskDictionary(const SkPdfSoftMaskDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfSoftMaskDictionary& operator=(const SkPdfSoftMaskDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -584,11 +587,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BC", "", NULL));
   }
 
-  SkPdfArray BC() const {
-    SkPdfArray ret;
+  SkPdfArray* BC() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BC", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A function object (see Section 3.9, "Functions") specifying the
diff --git a/experimental/PdfViewer/SkPdfSoftMaskImageDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfSoftMaskImageDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfSoftMaskImageDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfSoftMaskImageDictionary_autogen.h
index 61aadd1..4ca3995 100644
--- a/experimental/PdfViewer/SkPdfSoftMaskImageDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfSoftMaskImageDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfSoftMaskImageDictionary
 #define __DEFINED__SkPdfSoftMaskImageDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfSoftMaskImageDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfSoftMaskImageDictionary(const SkPdfSoftMaskImageDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfSoftMaskImageDictionary& operator=(const SkPdfSoftMaskImageDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -533,11 +536,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matte", "", NULL));
   }
 
-  SkPdfArray Matte() const {
-    SkPdfArray ret;
+  SkPdfArray* Matte() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matte", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfSoundActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfSoundActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfSoundActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfSoundActionDictionary_autogen.h
index dccc190..be04ec6 100644
--- a/experimental/PdfViewer/SkPdfSoundActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfSoundActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfSoundActionDictionary
 #define __DEFINED__SkPdfSoundActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfSoundActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfSoundActionDictionary(const SkPdfSoundActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfSoundActionDictionary& operator=(const SkPdfSoundActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfSoundAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfSoundAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfSoundAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfSoundAnnotationDictionary_autogen.h
index cca1b99..523ff1d 100644
--- a/experimental/PdfViewer/SkPdfSoundAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfSoundAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfSoundAnnotationDictionary
 #define __DEFINED__SkPdfSoundAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfSoundAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfSoundAnnotationDictionary(const SkPdfSoundAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfSoundAnnotationDictionary& operator=(const SkPdfSoundAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfSoundObjectDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfSoundObjectDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfSoundObjectDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfSoundObjectDictionary_autogen.h
index 0ce66f1..09ff7d0 100644
--- a/experimental/PdfViewer/SkPdfSoundObjectDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfSoundObjectDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfSoundObjectDictionary
 #define __DEFINED__SkPdfSoundObjectDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfSoundObjectDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfSoundObjectDictionary(const SkPdfSoundObjectDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfSoundObjectDictionary& operator=(const SkPdfSoundObjectDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfSourceInformationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfSourceInformationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfSourceInformationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfSourceInformationDictionary_autogen.h
index 61a2426..27d01d5 100644
--- a/experimental/PdfViewer/SkPdfSourceInformationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfSourceInformationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfSourceInformationDictionary
 #define __DEFINED__SkPdfSourceInformationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfSourceInformationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfSourceInformationDictionary(const SkPdfSourceInformationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfSourceInformationDictionary& operator=(const SkPdfSourceInformationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfSquareOrCircleAnnotation_autogen.h b/experimental/PdfViewer/autogen/SkPdfSquareOrCircleAnnotation_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfSquareOrCircleAnnotation_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfSquareOrCircleAnnotation_autogen.h
index aab9fb2..1c746d6 100644
--- a/experimental/PdfViewer/SkPdfSquareOrCircleAnnotation_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfSquareOrCircleAnnotation_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfSquareOrCircleAnnotation
 #define __DEFINED__SkPdfSquareOrCircleAnnotation
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfSquareOrCircleAnnotation(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfSquareOrCircleAnnotation(const SkPdfSquareOrCircleAnnotation& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfSquareOrCircleAnnotation& operator=(const SkPdfSquareOrCircleAnnotation& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -576,11 +579,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IC", "", NULL));
   }
 
-  SkPdfArray IC() const {
-    SkPdfArray ret;
+  SkPdfArray* IC() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IC", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfStandardSecurityHandlerDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfStandardSecurityHandlerDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfStandardSecurityHandlerDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfStandardSecurityHandlerDictionary_autogen.h
index 5d7b28d..55ba347 100644
--- a/experimental/PdfViewer/SkPdfStandardSecurityHandlerDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfStandardSecurityHandlerDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfStandardSecurityHandlerDictionary
 #define __DEFINED__SkPdfStandardSecurityHandlerDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfStandardSecurityHandlerDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfStandardSecurityHandlerDictionary(const SkPdfStandardSecurityHandlerDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfStandardSecurityHandlerDictionary& operator=(const SkPdfStandardSecurityHandlerDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfStandardStructureDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfStandardStructureDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfStandardStructureDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfStandardStructureDictionary_autogen.h
index b842f17..4f08d5e 100644
--- a/experimental/PdfViewer/SkPdfStandardStructureDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfStandardStructureDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfStandardStructureDictionary
 #define __DEFINED__SkPdfStandardStructureDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfStandardStructureDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfStandardStructureDictionary(const SkPdfStandardStructureDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfStandardStructureDictionary& operator=(const SkPdfStandardStructureDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfStreamCommonDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfStreamCommonDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfStreamCommonDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfStreamCommonDictionary_autogen.h
index a969b99..b1f86c5 100644
--- a/experimental/PdfViewer/SkPdfStreamCommonDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfStreamCommonDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfStreamCommonDictionary
 #define __DEFINED__SkPdfStreamCommonDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfStreamCommonDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfStreamCommonDictionary(const SkPdfStreamCommonDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfStreamCommonDictionary& operator=(const SkPdfStreamCommonDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -568,11 +571,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getFilterAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getFilterAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A parameter dictionary, or an array of such dictionaries,
@@ -611,11 +614,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getDecodeParmsAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getDecodeParmsAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DecodeParms", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.2) The file containing the stream data. If this entry
@@ -663,11 +666,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getFFilterAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getFFilterAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FFilter", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; PDF 1.2) A parameter dictionary, or an array of such dic-
@@ -697,11 +700,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getFDecodeParmsAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getFDecodeParmsAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FDecodeParms", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfReference_autogen.h b/experimental/PdfViewer/autogen/SkPdfStream_autogen.h
similarity index 96%
copy from experimental/PdfViewer/SkPdfReference_autogen.h
copy to experimental/PdfViewer/autogen/SkPdfStream_autogen.h
index 2c3aa27..911db8d 100644
--- a/experimental/PdfViewer/SkPdfReference_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfStream_autogen.h
@@ -1,17 +1,18 @@
-#ifndef __DEFINED__SkPdfReference
-#define __DEFINED__SkPdfReference
+#ifndef __DEFINED__SkPdfStream
+#define __DEFINED__SkPdfStream
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfObject_autogen.h"
 
-class SkPdfReference : public SkPdfObject {
+class SkPdfStream : public SkPdfObject {
 public:
-  virtual SkPdfObjectType getType() const { return kReference_SkPdfObjectType;}
-  virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kReference_SkPdfObjectType + 1);}
+  virtual SkPdfObjectType getType() const { return kStream_SkPdfObjectType;}
+  virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kStream_SkPdfObjectType + 1);}
 public:
-  virtual SkPdfReference* asReference() {return this;}
-  virtual const SkPdfReference* asReference() const {return this;}
+  virtual SkPdfStream* asStream() {return this;}
+  virtual const SkPdfStream* asStream() const {return this;}
 
 private:
   virtual SkPdfArray* asArray() {return NULL;}
@@ -176,9 +177,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -188,6 +186,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -536,8 +537,8 @@
   virtual SkPdfNull* asNull() {return NULL;}
   virtual const SkPdfNull* asNull() const {return NULL;}
 
-  virtual SkPdfStream* asStream() {return NULL;}
-  virtual const SkPdfStream* asStream() const {return NULL;}
+  virtual SkPdfReference* asReference() {return NULL;}
+  virtual const SkPdfReference* asReference() const {return NULL;}
 
   virtual SkPdfString* asString() {return NULL;}
   virtual const SkPdfString* asString() const {return NULL;}
@@ -548,12 +549,14 @@
 public:
 private:
 public:
-  SkPdfReference(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfObject(podofoDoc, podofoObj) {}
+  SkPdfStream(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfObject(podofoDoc, podofoObj) {}
+
+  SkPdfStream(const SkPdfStream& from) : SkPdfObject(from.fPodofoDoc, from.fPodofoObj) {}
 
   virtual bool valid() const {return true;}
 
-  SkPdfReference& operator=(const SkPdfReference& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
+  SkPdfStream& operator=(const SkPdfStream& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
 
 };
 
-#endif  // __DEFINED__SkPdfReference
+#endif  // __DEFINED__SkPdfStream
diff --git a/experimental/PdfViewer/SkPdfString_autogen.h b/experimental/PdfViewer/autogen/SkPdfString_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfString_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfString_autogen.h
index 29a6505..e14199b 100644
--- a/experimental/PdfViewer/SkPdfString_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfString_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfString
 #define __DEFINED__SkPdfString
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfObject_autogen.h"
@@ -176,9 +177,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -188,6 +186,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -548,6 +549,8 @@
 public:
   SkPdfString(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfObject(podofoDoc, podofoObj) {}
 
+  SkPdfString(const SkPdfString& from) : SkPdfObject(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfString& operator=(const SkPdfString& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfStructureElementAccessDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfStructureElementAccessDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfStructureElementAccessDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfStructureElementAccessDictionary_autogen.h
index e7ae745..1dc8bb0 100644
--- a/experimental/PdfViewer/SkPdfStructureElementAccessDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfStructureElementAccessDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfStructureElementAccessDictionary
 #define __DEFINED__SkPdfStructureElementAccessDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfStructureElementAccessDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfStructureElementAccessDictionary(const SkPdfStructureElementAccessDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfStructureElementAccessDictionary& operator=(const SkPdfStructureElementAccessDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfStructureElementDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfStructureElementDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfStructureElementDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfStructureElementDictionary_autogen.h
index 98987f4..b7b90da 100644
--- a/experimental/PdfViewer/SkPdfStructureElementDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfStructureElementDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfStructureElementDictionary
 #define __DEFINED__SkPdfStructureElementDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfStructureElementDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfStructureElementDictionary(const SkPdfStructureElementDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfStructureElementDictionary& operator=(const SkPdfStructureElementDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -671,11 +674,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getCAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getCAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) The current revision number of this structure element (see
diff --git a/experimental/PdfViewer/SkPdfStructureTreeRootDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfStructureTreeRootDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfStructureTreeRootDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfStructureTreeRootDictionary_autogen.h
index 184848f..83f337e 100644
--- a/experimental/PdfViewer/SkPdfStructureTreeRootDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfStructureTreeRootDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfStructureTreeRootDictionary
 #define __DEFINED__SkPdfStructureTreeRootDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfStructureTreeRootDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfStructureTreeRootDictionary(const SkPdfStructureTreeRootDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfStructureTreeRootDictionary& operator=(const SkPdfStructureTreeRootDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -563,11 +566,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getKAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getKAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "K", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required if any structure elements have element identifiers) A name tree
diff --git a/experimental/PdfViewer/SkPdfSubmitFormActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfSubmitFormActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfSubmitFormActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfSubmitFormActionDictionary_autogen.h
index a6c6a91..178a223 100644
--- a/experimental/PdfViewer/SkPdfSubmitFormActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfSubmitFormActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfSubmitFormActionDictionary
 #define __DEFINED__SkPdfSubmitFormActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfSubmitFormActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfSubmitFormActionDictionary(const SkPdfSubmitFormActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfSubmitFormActionDictionary& operator=(const SkPdfSubmitFormActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -568,11 +571,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Fields", "", NULL));
   }
 
-  SkPdfArray Fields() const {
-    SkPdfArray ret;
+  SkPdfArray* Fields() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Fields", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional; inheritable) A set of flags specifying various characteris-
diff --git a/experimental/PdfViewer/SkPdfTableAttributesDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfTableAttributesDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfTableAttributesDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfTableAttributesDictionary_autogen.h
index 8ec03a9..2fd1fc0 100644
--- a/experimental/PdfViewer/SkPdfTableAttributesDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfTableAttributesDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfTableAttributesDictionary
 #define __DEFINED__SkPdfTableAttributesDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfTableAttributesDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfTableAttributesDictionary(const SkPdfTableAttributesDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfTableAttributesDictionary& operator=(const SkPdfTableAttributesDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfTextAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfTextAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfTextAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfTextAnnotationDictionary_autogen.h
index 7e94e46..a52d7bf 100644
--- a/experimental/PdfViewer/SkPdfTextAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfTextAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfTextAnnotationDictionary
 #define __DEFINED__SkPdfTextAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfTextAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfTextAnnotationDictionary(const SkPdfTextAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfTextAnnotationDictionary& operator=(const SkPdfTextAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfTextFieldDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfTextFieldDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfTextFieldDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfTextFieldDictionary_autogen.h
index fb07aab..56c6472 100644
--- a/experimental/PdfViewer/SkPdfTextFieldDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfTextFieldDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfTextFieldDictionary
 #define __DEFINED__SkPdfTextFieldDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfTextFieldDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfTextFieldDictionary(const SkPdfTextFieldDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfTextFieldDictionary& operator=(const SkPdfTextFieldDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfThreadActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfThreadActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfThreadActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfThreadActionDictionary_autogen.h
index 997d30f..3158d85 100644
--- a/experimental/PdfViewer/SkPdfThreadActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfThreadActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfThreadActionDictionary
 #define __DEFINED__SkPdfThreadActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfThreadActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfThreadActionDictionary(const SkPdfThreadActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfThreadActionDictionary& operator=(const SkPdfThreadActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfThreadDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfThreadDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfThreadDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfThreadDictionary_autogen.h
index 1fcbb17..98ccf37 100644
--- a/experimental/PdfViewer/SkPdfThreadDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfThreadDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfThreadDictionary
 #define __DEFINED__SkPdfThreadDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfThreadDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfThreadDictionary(const SkPdfThreadDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfThreadDictionary& operator=(const SkPdfThreadDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfTransitionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfTransitionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfTransitionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfTransitionDictionary_autogen.h
index 4cdee7f..64cbeb6 100644
--- a/experimental/PdfViewer/SkPdfTransitionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfTransitionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfTransitionDictionary
 #define __DEFINED__SkPdfTransitionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfTransitionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfTransitionDictionary(const SkPdfTransitionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfTransitionDictionary& operator=(const SkPdfTransitionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfTransparencyGroupDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfTransparencyGroupDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfTransparencyGroupDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfTransparencyGroupDictionary_autogen.h
index efcc411..e883767 100644
--- a/experimental/PdfViewer/SkPdfTransparencyGroupDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfTransparencyGroupDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfTransparencyGroupDictionary
 #define __DEFINED__SkPdfTransparencyGroupDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfTransparencyGroupDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfTransparencyGroupDictionary(const SkPdfTransparencyGroupDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfTransparencyGroupDictionary& operator=(const SkPdfTransparencyGroupDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -591,11 +594,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getCSAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getCSAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CS", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfTrapNetworkAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfTrapNetworkAnnotationDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfTrapNetworkAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfTrapNetworkAnnotationDictionary_autogen.h
index 838f713..6c7cf0e 100644
--- a/experimental/PdfViewer/SkPdfTrapNetworkAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfTrapNetworkAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfTrapNetworkAnnotationDictionary
 #define __DEFINED__SkPdfTrapNetworkAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfTrapNetworkAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfTrapNetworkAnnotationDictionary(const SkPdfTrapNetworkAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfTrapNetworkAnnotationDictionary& operator=(const SkPdfTrapNetworkAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -585,11 +588,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Version", "", NULL));
   }
 
-  SkPdfArray Version() const {
-    SkPdfArray ret;
+  SkPdfArray* Version() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Version", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required if Version is present; must be absent if LastModified is present) An
@@ -604,11 +607,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AnnotStates", "", NULL));
   }
 
-  SkPdfArray AnnotStates() const {
-    SkPdfArray ret;
+  SkPdfArray* AnnotStates() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AnnotStates", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of font dictionaries representing fonts that were "fauxed"
@@ -619,11 +622,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontFauxing", "", NULL));
   }
 
-  SkPdfArray FontFauxing() const {
-    SkPdfArray ret;
+  SkPdfArray* FontFauxing() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontFauxing", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfTrapNetworkAppearanceStreamDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfTrapNetworkAppearanceStreamDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfTrapNetworkAppearanceStreamDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfTrapNetworkAppearanceStreamDictionary_autogen.h
index 10f5d88..289058c 100644
--- a/experimental/PdfViewer/SkPdfTrapNetworkAppearanceStreamDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfTrapNetworkAppearanceStreamDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfTrapNetworkAppearanceStreamDictionary
 #define __DEFINED__SkPdfTrapNetworkAppearanceStreamDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfTrapNetworkAppearanceStreamDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfTrapNetworkAppearanceStreamDictionary(const SkPdfTrapNetworkAppearanceStreamDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfTrapNetworkAppearanceStreamDictionary& operator=(const SkPdfTrapNetworkAppearanceStreamDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -552,11 +555,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SeparationColorNames", "", NULL));
   }
 
-  SkPdfArray SeparationColorNames() const {
-    SkPdfArray ret;
+  SkPdfArray* SeparationColorNames() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SeparationColorNames", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of indirect references to TrapRegion objects
@@ -572,11 +575,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TrapRegions", "", NULL));
   }
 
-  SkPdfArray TrapRegions() const {
-    SkPdfArray ret;
+  SkPdfArray* TrapRegions() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TrapRegions", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A human-readable text string that applications can use
diff --git a/experimental/PdfViewer/SkPdfTrueTypeFontDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfTrueTypeFontDictionary_autogen.h
similarity index 84%
rename from experimental/PdfViewer/SkPdfTrueTypeFontDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfTrueTypeFontDictionary_autogen.h
index 6684b30..8c2297f 100644
--- a/experimental/PdfViewer/SkPdfTrueTypeFontDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfTrueTypeFontDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfTrueTypeFontDictionary
 #define __DEFINED__SkPdfTrueTypeFontDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfType1FontDictionary_autogen.h"
@@ -17,11 +18,16 @@
   virtual SkPdfMultiMasterFontDictionary* asMultiMasterFontDictionary() {return NULL;}
   virtual const SkPdfMultiMasterFontDictionary* asMultiMasterFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
 public:
 private:
 public:
   SkPdfTrueTypeFontDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfType1FontDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfTrueTypeFontDictionary(const SkPdfTrueTypeFontDictionary& from) : SkPdfType1FontDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfTrueTypeFontDictionary& operator=(const SkPdfTrueTypeFontDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfType0FontDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType0FontDictionary_autogen.h
similarity index 92%
rename from experimental/PdfViewer/SkPdfType0FontDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType0FontDictionary_autogen.h
index f11d3d3..c556575 100644
--- a/experimental/PdfViewer/SkPdfType0FontDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType0FontDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType0FontDictionary
 #define __DEFINED__SkPdfType0FontDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfFontDictionary_autogen.h"
@@ -9,7 +10,7 @@
 class SkPdfType0FontDictionary : public SkPdfFontDictionary {
 public:
   virtual SkPdfObjectType getType() const { return kType0FontDictionary_SkPdfObjectType;}
-  virtual SkPdfObjectType getTypeEnd() const { return kType0FontDictionary__End_SkPdfObjectType;}
+  virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType0FontDictionary_SkPdfObjectType + 1);}
 public:
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return this;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return this;}
@@ -27,11 +28,16 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
 public:
 private:
 public:
   SkPdfType0FontDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfFontDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType0FontDictionary(const SkPdfType0FontDictionary& from) : SkPdfFontDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType0FontDictionary& operator=(const SkPdfType0FontDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -131,11 +137,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DescendantFonts", "", NULL));
   }
 
-  SkPdfArray DescendantFonts() const {
-    SkPdfArray ret;
+  SkPdfArray* DescendantFonts() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DescendantFonts", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A stream containing a CMap file that maps character codes to
diff --git a/experimental/PdfViewer/SkPdfType0FunctionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType0FunctionDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfType0FunctionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType0FunctionDictionary_autogen.h
index d9f9382..a414a47 100644
--- a/experimental/PdfViewer/SkPdfType0FunctionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType0FunctionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType0FunctionDictionary
 #define __DEFINED__SkPdfType0FunctionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfType0FunctionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType0FunctionDictionary(const SkPdfType0FunctionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType0FunctionDictionary& operator=(const SkPdfType0FunctionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -529,11 +532,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Size", "", NULL));
   }
 
-  SkPdfArray Size() const {
-    SkPdfArray ret;
+  SkPdfArray* Size() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Size", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) The number of bits used to represent each sample. (If the function
@@ -574,11 +577,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Encode", "", NULL));
   }
 
-  SkPdfArray Encode() const {
-    SkPdfArray ret;
+  SkPdfArray* Encode() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Encode", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of 2 x n numbers specifying the linear mapping of sam-
@@ -589,11 +592,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "", NULL));
   }
 
-  SkPdfArray Decode() const {
-    SkPdfArray ret;
+  SkPdfArray* Decode() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfType10HalftoneDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType10HalftoneDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfType10HalftoneDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType10HalftoneDictionary_autogen.h
index 9d64741..30e6215 100644
--- a/experimental/PdfViewer/SkPdfType10HalftoneDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType10HalftoneDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType10HalftoneDictionary
 #define __DEFINED__SkPdfType10HalftoneDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfType10HalftoneDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType10HalftoneDictionary(const SkPdfType10HalftoneDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType10HalftoneDictionary& operator=(const SkPdfType10HalftoneDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfType16HalftoneDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType16HalftoneDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfType16HalftoneDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType16HalftoneDictionary_autogen.h
index ebd863e..4eacd84 100644
--- a/experimental/PdfViewer/SkPdfType16HalftoneDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType16HalftoneDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType16HalftoneDictionary
 #define __DEFINED__SkPdfType16HalftoneDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfType16HalftoneDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType16HalftoneDictionary(const SkPdfType16HalftoneDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType16HalftoneDictionary& operator=(const SkPdfType16HalftoneDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfType1FontDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType1FontDictionary_autogen.h
similarity index 97%
rename from experimental/PdfViewer/SkPdfType1FontDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType1FontDictionary_autogen.h
index 88a85ec..bb5382b 100644
--- a/experimental/PdfViewer/SkPdfType1FontDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType1FontDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType1FontDictionary
 #define __DEFINED__SkPdfType1FontDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfFontDictionary_autogen.h"
@@ -21,14 +22,13 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
 public:
 private:
 public:
   SkPdfType1FontDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfFontDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType1FontDictionary(const SkPdfType1FontDictionary& from) : SkPdfFontDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType1FontDictionary& operator=(const SkPdfType1FontDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -137,11 +137,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Widths", "", NULL));
   }
 
-  SkPdfArray Widths() const {
-    SkPdfArray ret;
+  SkPdfArray* Widths() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Widths", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required except for the standard 14 fonts; must be an indirect reference) A font
diff --git a/experimental/PdfViewer/SkPdfType1FormDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType1FormDictionary_autogen.h
similarity index 95%
rename from experimental/PdfViewer/SkPdfType1FormDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType1FormDictionary_autogen.h
index b04c539..e975649 100644
--- a/experimental/PdfViewer/SkPdfType1FormDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType1FormDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType1FormDictionary
 #define __DEFINED__SkPdfType1FormDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfXObjectDictionary_autogen.h"
@@ -23,6 +24,8 @@
 public:
   SkPdfType1FormDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfXObjectDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType1FormDictionary(const SkPdfType1FormDictionary& from) : SkPdfXObjectDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType1FormDictionary& operator=(const SkPdfType1FormDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -114,11 +117,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BBox", "", NULL));
   }
 
-  SkRect BBox() const {
-    SkRect ret;
+  SkRect* BBox() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BBox", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Optional) An array of six numbers specifying the form matrix, which maps
@@ -129,11 +132,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", "", NULL));
   }
 
-  SkPdfArray Matrix() const {
-    SkPdfArray ret;
-    if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", "", &ret)) return ret;
+  SkMatrix* Matrix() const {
+    SkMatrix* ret;
+    if (SkMatrixFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional but strongly recommended; PDF 1.2) A dictionary specifying any
@@ -158,9 +161,9 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Resources", "", NULL));
   }
 
-  SkPdfDictionary* Resources() const {
-    SkPdfDictionary* ret;
-    if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Resources", "", &ret)) return ret;
+  SkPdfResourceDictionary* Resources() const {
+    SkPdfResourceDictionary* ret;
+    if (DictionaryFromDictionary2(fPodofoDoc, fPodofoObj->GetDictionary(), "Resources", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
     return NULL;
   }
diff --git a/experimental/PdfViewer/SkPdfType1HalftoneDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType1HalftoneDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfType1HalftoneDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType1HalftoneDictionary_autogen.h
index 097ed46..0f229d9 100644
--- a/experimental/PdfViewer/SkPdfType1HalftoneDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType1HalftoneDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType1HalftoneDictionary
 #define __DEFINED__SkPdfType1HalftoneDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfType1HalftoneDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType1HalftoneDictionary(const SkPdfType1HalftoneDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType1HalftoneDictionary& operator=(const SkPdfType1HalftoneDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfType1PatternDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType1PatternDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfType1PatternDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType1PatternDictionary_autogen.h
index fc4700f..d191df0 100644
--- a/experimental/PdfViewer/SkPdfType1PatternDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType1PatternDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType1PatternDictionary
 #define __DEFINED__SkPdfType1PatternDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfType1PatternDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType1PatternDictionary(const SkPdfType1PatternDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType1PatternDictionary& operator=(const SkPdfType1PatternDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfType1ShadingDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType1ShadingDictionary_autogen.h
similarity index 93%
rename from experimental/PdfViewer/SkPdfType1ShadingDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType1ShadingDictionary_autogen.h
index dcbb6b4..6d2b740 100644
--- a/experimental/PdfViewer/SkPdfType1ShadingDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType1ShadingDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType1ShadingDictionary
 #define __DEFINED__SkPdfType1ShadingDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfShadingDictionary_autogen.h"
@@ -35,6 +36,8 @@
 public:
   SkPdfType1ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType1ShadingDictionary(const SkPdfType1ShadingDictionary& from) : SkPdfShadingDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType1ShadingDictionary& operator=(const SkPdfType1ShadingDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -47,11 +50,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "", NULL));
   }
 
-  SkPdfArray Domain() const {
-    SkPdfArray ret;
+  SkPdfArray* Domain() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of six numbers specifying a transformation matrix mapping
@@ -65,11 +68,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", "", NULL));
   }
 
-  SkPdfArray Matrix() const {
-    SkPdfArray ret;
+  SkPdfArray* Matrix() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) A 2-in, n-out function or an array of n 2-in, 1-out functions (where n
diff --git a/experimental/PdfViewer/SkPdfType2FunctionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType2FunctionDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfType2FunctionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType2FunctionDictionary_autogen.h
index 609e0b3..accbfd1 100644
--- a/experimental/PdfViewer/SkPdfType2FunctionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType2FunctionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType2FunctionDictionary
 #define __DEFINED__SkPdfType2FunctionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfType2FunctionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType2FunctionDictionary(const SkPdfType2FunctionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType2FunctionDictionary& operator=(const SkPdfType2FunctionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -529,11 +532,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C0", "", NULL));
   }
 
-  SkPdfArray C0() const {
-    SkPdfArray ret;
+  SkPdfArray* C0() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C0", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of n numbers defining the function result when x = 1.0 (hence the "1"
@@ -543,11 +546,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C1", "", NULL));
   }
 
-  SkPdfArray C1() const {
-    SkPdfArray ret;
+  SkPdfArray* C1() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C1", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) The interpolation exponent. Each input value x will return n values, given by
diff --git a/experimental/PdfViewer/SkPdfType2PatternDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType2PatternDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfType2PatternDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType2PatternDictionary_autogen.h
index 2814fe1..d88fa8a 100644
--- a/experimental/PdfViewer/SkPdfType2PatternDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType2PatternDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType2PatternDictionary
 #define __DEFINED__SkPdfType2PatternDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfType2PatternDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType2PatternDictionary(const SkPdfType2PatternDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType2PatternDictionary& operator=(const SkPdfType2PatternDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -592,11 +595,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", "", NULL));
   }
 
-  SkPdfArray Matrix() const {
-    SkPdfArray ret;
+  SkPdfArray* Matrix() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A graphics state parameter dictionary (see Section 4.3.4, "Graph-
diff --git a/experimental/PdfViewer/SkPdfType2ShadingDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType2ShadingDictionary_autogen.h
similarity index 92%
rename from experimental/PdfViewer/SkPdfType2ShadingDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType2ShadingDictionary_autogen.h
index b56edf4..8b5667f 100644
--- a/experimental/PdfViewer/SkPdfType2ShadingDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType2ShadingDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType2ShadingDictionary
 #define __DEFINED__SkPdfType2ShadingDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfShadingDictionary_autogen.h"
@@ -35,6 +36,8 @@
 public:
   SkPdfType2ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType2ShadingDictionary(const SkPdfType2ShadingDictionary& from) : SkPdfShadingDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType2ShadingDictionary& operator=(const SkPdfType2ShadingDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -47,11 +50,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coords", "", NULL));
   }
 
-  SkPdfArray Coords() const {
-    SkPdfArray ret;
+  SkPdfArray* Coords() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coords", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of two numbers [ t0 t1 ] specifying the limiting values of a
@@ -64,11 +67,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "", NULL));
   }
 
-  SkPdfArray Domain() const {
-    SkPdfArray ret;
+  SkPdfArray* Domain() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) A 1-in, n-out function or an array of n 1-in, 1-out functions (where n
@@ -97,11 +100,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Extend", "", NULL));
   }
 
-  SkPdfArray Extend() const {
-    SkPdfArray ret;
+  SkPdfArray* Extend() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Extend", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/autogen/SkPdfType3FontDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType3FontDictionary_autogen.h
new file mode 100644
index 0000000..079930e
--- /dev/null
+++ b/experimental/PdfViewer/autogen/SkPdfType3FontDictionary_autogen.h
@@ -0,0 +1,246 @@
+#ifndef __DEFINED__SkPdfType3FontDictionary
+#define __DEFINED__SkPdfType3FontDictionary
+
+#include "SkPdfUtils.h"
+#include "SkPdfEnums_autogen.h"
+#include "SkPdfArray_autogen.h"
+#include "SkPdfType1FontDictionary_autogen.h"
+
+// Entries in a Type 3 font dictionary
+class SkPdfType3FontDictionary : public SkPdfType1FontDictionary {
+public:
+  virtual SkPdfObjectType getType() const { return kType3FontDictionary_SkPdfObjectType;}
+  virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType3FontDictionary_SkPdfObjectType + 1);}
+public:
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return this;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return this;}
+
+private:
+  virtual SkPdfMultiMasterFontDictionary* asMultiMasterFontDictionary() {return NULL;}
+  virtual const SkPdfMultiMasterFontDictionary* asMultiMasterFontDictionary() const {return NULL;}
+
+  virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
+  virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
+
+public:
+private:
+public:
+  SkPdfType3FontDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfType1FontDictionary(podofoDoc, podofoObj) {}
+
+  SkPdfType3FontDictionary(const SkPdfType3FontDictionary& from) : SkPdfType1FontDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
+  virtual bool valid() const {return true;}
+
+  SkPdfType3FontDictionary& operator=(const SkPdfType3FontDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
+
+/** (Required) The type of PDF object that this dictionary describes; must be
+ *  Font for a font dictionary.
+**/
+  bool has_Type() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "", NULL));
+  }
+
+  std::string Type() const {
+    std::string ret;
+    if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return "";
+  }
+
+/** (Required) The type of font; must be Type3 for a Type 3 font.
+**/
+  bool has_Subtype() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "", NULL));
+  }
+
+  std::string Subtype() const {
+    std::string ret;
+    if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return "";
+  }
+
+/** (Required in PDF 1.0; optional otherwise) See Table 5.8 on page 317.
+**/
+  bool has_Name() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name", "", NULL));
+  }
+
+  std::string Name() const {
+    std::string ret;
+    if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return "";
+  }
+
+/** (Required) A rectangle (see Section 3.8.3, "Rectangles"), expressed in the
+ *  glyph coordinate system, specifying the font bounding box. This is the small-
+ *  est rectangle enclosing the shape that would result if all of the glyphs of the
+ *  font were placed with their origins coincident and then filled.
+ *  If all four elements of the rectangle are zero, no assumptions are made based
+ *  on the font bounding box. If any element is nonzero, it is essential that the
+ *  font bounding box be accurate; if any glyph's marks fall outside this bound-
+ *  ing box, incorrect behavior may result.
+**/
+  bool has_FontBBox() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontBBox", "", NULL));
+  }
+
+  SkRect* FontBBox() const {
+    SkRect* ret;
+    if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontBBox", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return NULL;
+  }
+
+/** (Required) An array of six numbers specifying the font matrix, mapping
+ *  glyph space to text space (see Section 5.1.3, "Glyph Positioning and
+ *  Metrics"). A common practice is to define glyphs in terms of a 1000-unit
+ *  glyph     coordinate      system,     in    which    case the font    matrix    is
+ *  [0.001 0 0 0.001 0 0].
+**/
+  bool has_FontMatrix() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontMatrix", "", NULL));
+  }
+
+  SkMatrix* FontMatrix() const {
+    SkMatrix* ret;
+    if (SkMatrixFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FontMatrix", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return NULL;
+  }
+
+/** (Required) A dictionary in which each key is a character name and the value
+ *  associated with that key is a content stream that constructs and paints the
+ *  glyph for that character. The stream must include as its first operator either
+ *  d0 or d1. This is followed by operators describing one or more graphics
+ *  objects, which may include path, text, or image objects. See below for more
+ *  details about Type 3 glyph descriptions.
+**/
+  bool has_CharProcs() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CharProcs", "", NULL));
+  }
+
+  SkPdfDictionary* CharProcs() const {
+    SkPdfDictionary* ret;
+    if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CharProcs", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return NULL;
+  }
+
+/** (Required) An encoding dictionary whose Differences array specifies the
+ *  complete character encoding for this font (see Section 5.5.5, "Character
+ *  Encoding"; also see implementation note 46 in Appendix H).
+**/
+  bool has_Encoding() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Encoding", "", NULL));
+  }
+
+  bool isEncodingAName() const {
+    SkPdfObject* ret = NULL;
+    if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Encoding", "", &ret)) return false;
+    return ret->podofo()->GetDataType() == ePdfDataType_Name;
+  }
+
+  std::string getEncodingAsName() const {
+    std::string ret = "";
+    if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Encoding", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return "";
+  }
+
+  bool isEncodingAEncodingdictionary() const {
+    SkPdfObject* ret = NULL;
+    if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Encoding", "", &ret)) return false;
+    return ret->podofo()->GetDataType() == ePdfDataType_Dictionary;
+  }
+
+  SkPdfEncodingDictionary* getEncodingAsEncodingdictionary() const {
+    SkPdfEncodingDictionary* ret = NULL;
+    if (DictionaryFromDictionary2(fPodofoDoc, fPodofoObj->GetDictionary(), "Encoding", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return NULL;
+  }
+
+/** (Required) The first character code defined in the font's Widths array.
+**/
+  bool has_FirstChar() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FirstChar", "", NULL));
+  }
+
+  long FirstChar() const {
+    long ret;
+    if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FirstChar", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return 0;
+  }
+
+/** (Required) The last character code defined in the font's Widths array.
+**/
+  bool has_LastChar() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LastChar", "", NULL));
+  }
+
+  long LastChar() const {
+    long ret;
+    if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LastChar", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return 0;
+  }
+
+/** (Required; indirect reference preferred) An array of (LastChar - FirstChar + 1)
+ *  widths, each element being the glyph width for the character whose code is
+ *  FirstChar plus the array index. For character codes outside the range FirstChar
+ *  to LastChar, the width is 0. These widths are interpreted in glyph space as
+ *  specified by FontMatrix (unlike the widths of a Type 1 font, which are in
+ *  thousandths of a unit of text space).
+ *  Note: If FontMatrix specifies a rotation, only the horizontal component of the
+ *  transformed width is used. That is, the resulting displacement is always horizon-
+ *  tal in text space, as is the case for all simple fonts.
+**/
+  bool has_Widths() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Widths", "", NULL));
+  }
+
+  SkPdfArray* Widths() const {
+    SkPdfArray* ret;
+    if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Widths", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return NULL;
+  }
+
+/** (Optional but strongly recommended; PDF 1.2) A list of the named resources,
+ *  such as fonts and images, required by the glyph descriptions in this font (see
+ *  Section 3.7.2, "Resource Dictionaries"). If any glyph descriptions refer to
+ *  named resources but this dictionary is absent, the names are looked up in the
+ *  resource dictionary of the page on which the font is used. (See implementa-
+ *  tion note 47 in Appendix H.)
+**/
+  bool has_Resources() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Resources", "", NULL));
+  }
+
+  SkPdfDictionary* Resources() const {
+    SkPdfDictionary* ret;
+    if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Resources", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return NULL;
+  }
+
+/** (Optional; PDF 1.2) A stream containing a CMap file that maps character
+ *  codes to Unicode values (see Section 5.9, "ToUnicode CMaps").
+**/
+  bool has_ToUnicode() const {
+    return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ToUnicode", "", NULL));
+  }
+
+  SkPdfStream* ToUnicode() const {
+    SkPdfStream* ret;
+    if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ToUnicode", "", &ret)) return ret;
+    // TODO(edisonn): warn about missing required field, assert for known good pdfs
+    return NULL;
+  }
+
+};
+
+#endif  // __DEFINED__SkPdfType3FontDictionary
diff --git a/experimental/PdfViewer/SkPdfType3FunctionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType3FunctionDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfType3FunctionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType3FunctionDictionary_autogen.h
index cc8feed..b09b9fa 100644
--- a/experimental/PdfViewer/SkPdfType3FunctionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType3FunctionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType3FunctionDictionary
 #define __DEFINED__SkPdfType3FunctionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfType3FunctionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType3FunctionDictionary(const SkPdfType3FunctionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType3FunctionDictionary& operator=(const SkPdfType3FunctionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -530,11 +533,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Functions", "", NULL));
   }
 
-  SkPdfArray Functions() const {
-    SkPdfArray ret;
+  SkPdfArray* Functions() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Functions", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) An array of k - 1 numbers that, in combination with Domain, define the
@@ -546,11 +549,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Bounds", "", NULL));
   }
 
-  SkPdfArray Bounds() const {
-    SkPdfArray ret;
+  SkPdfArray* Bounds() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Bounds", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) An array of 2 x k numbers that, taken in pairs, map each subset of the do-
@@ -561,11 +564,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Encode", "", NULL));
   }
 
-  SkPdfArray Encode() const {
-    SkPdfArray ret;
+  SkPdfArray* Encode() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Encode", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfType3ShadingDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType3ShadingDictionary_autogen.h
similarity index 92%
rename from experimental/PdfViewer/SkPdfType3ShadingDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType3ShadingDictionary_autogen.h
index 91e25f4..cff6013 100644
--- a/experimental/PdfViewer/SkPdfType3ShadingDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType3ShadingDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType3ShadingDictionary
 #define __DEFINED__SkPdfType3ShadingDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfShadingDictionary_autogen.h"
@@ -35,6 +36,8 @@
 public:
   SkPdfType3ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType3ShadingDictionary(const SkPdfType3ShadingDictionary& from) : SkPdfShadingDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType3ShadingDictionary& operator=(const SkPdfType3ShadingDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -49,11 +52,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coords", "", NULL));
   }
 
-  SkPdfArray Coords() const {
-    SkPdfArray ret;
+  SkPdfArray* Coords() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Coords", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) An array of two numbers [ t0 t1 ] specifying the limiting values of a
@@ -66,11 +69,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "", NULL));
   }
 
-  SkPdfArray Domain() const {
-    SkPdfArray ret;
+  SkPdfArray* Domain() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Domain", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) A 1-in, n-out function or an array of n 1-in, 1-out functions (where n
@@ -100,11 +103,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Extend", "", NULL));
   }
 
-  SkPdfArray Extend() const {
-    SkPdfArray ret;
+  SkPdfArray* Extend() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Extend", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfType4ShadingDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType4ShadingDictionary_autogen.h
similarity index 96%
rename from experimental/PdfViewer/SkPdfType4ShadingDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType4ShadingDictionary_autogen.h
index 6f9e180..eeb531d 100644
--- a/experimental/PdfViewer/SkPdfType4ShadingDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType4ShadingDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType4ShadingDictionary
 #define __DEFINED__SkPdfType4ShadingDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfShadingDictionary_autogen.h"
@@ -35,6 +36,8 @@
 public:
   SkPdfType4ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType4ShadingDictionary(const SkPdfType4ShadingDictionary& from) : SkPdfShadingDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType4ShadingDictionary& operator=(const SkPdfType4ShadingDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -95,11 +98,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "", NULL));
   }
 
-  SkRect Decode() const {
-    SkRect ret;
+  SkRect* Decode() const {
+    SkRect* ret;
     if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkRect();
+    return NULL;
   }
 
 /** (Optional) A 1-in, n-out function or an array of n 1-in, 1-out functions
diff --git a/experimental/PdfViewer/SkPdfType5HalftoneDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType5HalftoneDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfType5HalftoneDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType5HalftoneDictionary_autogen.h
index 4f54d05..d3b3e77 100644
--- a/experimental/PdfViewer/SkPdfType5HalftoneDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType5HalftoneDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType5HalftoneDictionary
 #define __DEFINED__SkPdfType5HalftoneDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfType5HalftoneDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType5HalftoneDictionary(const SkPdfType5HalftoneDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType5HalftoneDictionary& operator=(const SkPdfType5HalftoneDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfType5ShadingDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType5ShadingDictionary_autogen.h
similarity index 95%
rename from experimental/PdfViewer/SkPdfType5ShadingDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType5ShadingDictionary_autogen.h
index ef8f494..bfed8fb 100644
--- a/experimental/PdfViewer/SkPdfType5ShadingDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType5ShadingDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType5ShadingDictionary
 #define __DEFINED__SkPdfType5ShadingDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfShadingDictionary_autogen.h"
@@ -35,6 +36,8 @@
 public:
   SkPdfType5ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType5ShadingDictionary(const SkPdfType5ShadingDictionary& from) : SkPdfShadingDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType5ShadingDictionary& operator=(const SkPdfType5ShadingDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -94,11 +97,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "", NULL));
   }
 
-  SkPdfArray Decode() const {
-    SkPdfArray ret;
+  SkPdfArray* Decode() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A 1-in, n-out function or an array of n 1-in, 1-out functions
diff --git a/experimental/PdfViewer/SkPdfType6HalftoneDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType6HalftoneDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfType6HalftoneDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType6HalftoneDictionary_autogen.h
index d2017a6..74dac95 100644
--- a/experimental/PdfViewer/SkPdfType6HalftoneDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType6HalftoneDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType6HalftoneDictionary
 #define __DEFINED__SkPdfType6HalftoneDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfType6HalftoneDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType6HalftoneDictionary(const SkPdfType6HalftoneDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType6HalftoneDictionary& operator=(const SkPdfType6HalftoneDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfType6ShadingDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfType6ShadingDictionary_autogen.h
similarity index 96%
rename from experimental/PdfViewer/SkPdfType6ShadingDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfType6ShadingDictionary_autogen.h
index 825262b..dfb9fd4 100644
--- a/experimental/PdfViewer/SkPdfType6ShadingDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfType6ShadingDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfType6ShadingDictionary
 #define __DEFINED__SkPdfType6ShadingDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfShadingDictionary_autogen.h"
@@ -35,6 +36,8 @@
 public:
   SkPdfType6ShadingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfShadingDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfType6ShadingDictionary(const SkPdfType6ShadingDictionary& from) : SkPdfShadingDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfType6ShadingDictionary& operator=(const SkPdfType6ShadingDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -95,11 +98,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "", NULL));
   }
 
-  SkPdfArray Decode() const {
-    SkPdfArray ret;
+  SkPdfArray* Decode() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decode", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) A 1-in, n-out function or an array of n 1-in, 1-out functions
diff --git a/experimental/PdfViewer/SkPdfURIActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfURIActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfURIActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfURIActionDictionary_autogen.h
index 73af47f..8b21a61 100644
--- a/experimental/PdfViewer/SkPdfURIActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfURIActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfURIActionDictionary
 #define __DEFINED__SkPdfURIActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfURIActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfURIActionDictionary(const SkPdfURIActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfURIActionDictionary& operator=(const SkPdfURIActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfURIDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfURIDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfURIDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfURIDictionary_autogen.h
index d9631b6..a35b94e 100644
--- a/experimental/PdfViewer/SkPdfURIDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfURIDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfURIDictionary
 #define __DEFINED__SkPdfURIDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfURIDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfURIDictionary(const SkPdfURIDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfURIDictionary& operator=(const SkPdfURIDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfURLAliasDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfURLAliasDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfURLAliasDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfURLAliasDictionary_autogen.h
index e46f4a6..1360788 100644
--- a/experimental/PdfViewer/SkPdfURLAliasDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfURLAliasDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfURLAliasDictionary
 #define __DEFINED__SkPdfURLAliasDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfURLAliasDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfURLAliasDictionary(const SkPdfURLAliasDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfURLAliasDictionary& operator=(const SkPdfURLAliasDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -542,11 +545,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", NULL));
   }
 
-  SkPdfArray C() const {
-    SkPdfArray ret;
+  SkPdfArray* C() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfVariableTextFieldDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfVariableTextFieldDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfVariableTextFieldDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfVariableTextFieldDictionary_autogen.h
index 2225ea0..5543ca8 100644
--- a/experimental/PdfViewer/SkPdfVariableTextFieldDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfVariableTextFieldDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfVariableTextFieldDictionary
 #define __DEFINED__SkPdfVariableTextFieldDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfVariableTextFieldDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfVariableTextFieldDictionary(const SkPdfVariableTextFieldDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfVariableTextFieldDictionary& operator=(const SkPdfVariableTextFieldDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfViewerPreferencesDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfViewerPreferencesDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfViewerPreferencesDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfViewerPreferencesDictionary_autogen.h
index 45edd50..b604916 100644
--- a/experimental/PdfViewer/SkPdfViewerPreferencesDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfViewerPreferencesDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfViewerPreferencesDictionary
 #define __DEFINED__SkPdfViewerPreferencesDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfViewerPreferencesDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfViewerPreferencesDictionary(const SkPdfViewerPreferencesDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfViewerPreferencesDictionary& operator=(const SkPdfViewerPreferencesDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfWebCaptureCommandDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfWebCaptureCommandDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfWebCaptureCommandDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfWebCaptureCommandDictionary_autogen.h
index b6de61d..4627361 100644
--- a/experimental/PdfViewer/SkPdfWebCaptureCommandDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfWebCaptureCommandDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfWebCaptureCommandDictionary
 #define __DEFINED__SkPdfWebCaptureCommandDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfWebCaptureCommandDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfWebCaptureCommandDictionary(const SkPdfWebCaptureCommandDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfWebCaptureCommandDictionary& operator=(const SkPdfWebCaptureCommandDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfWebCaptureCommandSettingsDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfWebCaptureCommandSettingsDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfWebCaptureCommandSettingsDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfWebCaptureCommandSettingsDictionary_autogen.h
index 99c34b6..d471d14 100644
--- a/experimental/PdfViewer/SkPdfWebCaptureCommandSettingsDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfWebCaptureCommandSettingsDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfWebCaptureCommandSettingsDictionary
 #define __DEFINED__SkPdfWebCaptureCommandSettingsDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfWebCaptureCommandSettingsDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfWebCaptureCommandSettingsDictionary(const SkPdfWebCaptureCommandSettingsDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfWebCaptureCommandSettingsDictionary& operator=(const SkPdfWebCaptureCommandSettingsDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfWebCaptureDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfWebCaptureDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfWebCaptureDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfWebCaptureDictionary_autogen.h
index ef2924d..2460a7a 100644
--- a/experimental/PdfViewer/SkPdfWebCaptureDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfWebCaptureDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfWebCaptureDictionary
 #define __DEFINED__SkPdfWebCaptureDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfWebCaptureDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfWebCaptureDictionary(const SkPdfWebCaptureDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfWebCaptureDictionary& operator=(const SkPdfWebCaptureDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -574,11 +577,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "O", "", NULL));
   }
 
-  SkPdfArray O() const {
-    SkPdfArray ret;
+  SkPdfArray* O() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "O", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Required) A source information dictionary (see Section 9.9.4, "Source Information"),
@@ -608,11 +611,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getSIAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getSIAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SI", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 /** (Optional) The content type, a string characterizing the source from which the objects
diff --git a/experimental/PdfViewer/SkPdfWebCaptureImageSetDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfWebCaptureImageSetDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfWebCaptureImageSetDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfWebCaptureImageSetDictionary_autogen.h
index 2866896..287def7 100644
--- a/experimental/PdfViewer/SkPdfWebCaptureImageSetDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfWebCaptureImageSetDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfWebCaptureImageSetDictionary
 #define __DEFINED__SkPdfWebCaptureImageSetDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfWebCaptureImageSetDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfWebCaptureImageSetDictionary(const SkPdfWebCaptureImageSetDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfWebCaptureImageSetDictionary& operator=(const SkPdfWebCaptureImageSetDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -566,11 +569,11 @@
     return ret->podofo()->GetDataType() == ePdfDataType_Array;
   }
 
-  SkPdfArray getRAsArray() const {
-    SkPdfArray ret = SkPdfArray();
+  SkPdfArray* getRAsArray() const {
+    SkPdfArray* ret = NULL;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "R", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfWebCaptureInformationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfWebCaptureInformationDictionary_autogen.h
similarity index 98%
rename from experimental/PdfViewer/SkPdfWebCaptureInformationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfWebCaptureInformationDictionary_autogen.h
index 38d9986..d8593a0 100644
--- a/experimental/PdfViewer/SkPdfWebCaptureInformationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfWebCaptureInformationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfWebCaptureInformationDictionary
 #define __DEFINED__SkPdfWebCaptureInformationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfWebCaptureInformationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfWebCaptureInformationDictionary(const SkPdfWebCaptureInformationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfWebCaptureInformationDictionary& operator=(const SkPdfWebCaptureInformationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
@@ -546,11 +549,11 @@
     return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", NULL));
   }
 
-  SkPdfArray C() const {
-    SkPdfArray ret;
+  SkPdfArray* C() const {
+    SkPdfArray* ret;
     if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", &ret)) return ret;
     // TODO(edisonn): warn about missing required field, assert for known good pdfs
-    return SkPdfArray();
+    return NULL;
   }
 
 };
diff --git a/experimental/PdfViewer/SkPdfWebCapturePageSetDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfWebCapturePageSetDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfWebCapturePageSetDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfWebCapturePageSetDictionary_autogen.h
index cc9d05f..41c46d6 100644
--- a/experimental/PdfViewer/SkPdfWebCapturePageSetDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfWebCapturePageSetDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfWebCapturePageSetDictionary
 #define __DEFINED__SkPdfWebCapturePageSetDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfWebCapturePageSetDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfWebCapturePageSetDictionary(const SkPdfWebCapturePageSetDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfWebCapturePageSetDictionary& operator=(const SkPdfWebCapturePageSetDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfWidgetAnnotationDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfWidgetAnnotationDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfWidgetAnnotationDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfWidgetAnnotationDictionary_autogen.h
index bb687f2..ebe48fc 100644
--- a/experimental/PdfViewer/SkPdfWidgetAnnotationDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfWidgetAnnotationDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfWidgetAnnotationDictionary
 #define __DEFINED__SkPdfWidgetAnnotationDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfWidgetAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfWidgetAnnotationDictionary(const SkPdfWidgetAnnotationDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfWidgetAnnotationDictionary& operator=(const SkPdfWidgetAnnotationDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfWindowsLaunchActionDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfWindowsLaunchActionDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfWindowsLaunchActionDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfWindowsLaunchActionDictionary_autogen.h
index 201fe25..c1bce3e 100644
--- a/experimental/PdfViewer/SkPdfWindowsLaunchActionDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfWindowsLaunchActionDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfWindowsLaunchActionDictionary
 #define __DEFINED__SkPdfWindowsLaunchActionDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -168,9 +169,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -180,6 +178,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -518,6 +519,8 @@
 public:
   SkPdfWindowsLaunchActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfWindowsLaunchActionDictionary(const SkPdfWindowsLaunchActionDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfWindowsLaunchActionDictionary& operator=(const SkPdfWindowsLaunchActionDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/SkPdfXObjectDictionary_autogen.h b/experimental/PdfViewer/autogen/SkPdfXObjectDictionary_autogen.h
similarity index 99%
rename from experimental/PdfViewer/SkPdfXObjectDictionary_autogen.h
rename to experimental/PdfViewer/autogen/SkPdfXObjectDictionary_autogen.h
index f0dda14..888bee5 100644
--- a/experimental/PdfViewer/SkPdfXObjectDictionary_autogen.h
+++ b/experimental/PdfViewer/autogen/SkPdfXObjectDictionary_autogen.h
@@ -1,6 +1,7 @@
 #ifndef __DEFINED__SkPdfXObjectDictionary
 #define __DEFINED__SkPdfXObjectDictionary
 
+#include "SkPdfUtils.h"
 #include "SkPdfEnums_autogen.h"
 #include "SkPdfArray_autogen.h"
 #include "SkPdfDictionary_autogen.h"
@@ -167,9 +168,6 @@
   virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;}
   virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return NULL;}
 
-  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
-  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
-
   virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;}
   virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return NULL;}
 
@@ -179,6 +177,9 @@
   virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;}
   virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {return NULL;}
 
+  virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;}
+  virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return NULL;}
+
   virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {return NULL;}
   virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() const {return NULL;}
 
@@ -511,6 +512,8 @@
 public:
   SkPdfXObjectDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
 
+  SkPdfXObjectDictionary(const SkPdfXObjectDictionary& from) : SkPdfDictionary(from.fPodofoDoc, from.fPodofoObj) {}
+
   virtual bool valid() const {return true;}
 
   SkPdfXObjectDictionary& operator=(const SkPdfXObjectDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
diff --git a/experimental/PdfViewer/autogen/__init__.py b/experimental/PdfViewer/autogen/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/experimental/PdfViewer/autogen/__init__.py
diff --git a/experimental/PdfViewer/pdfspec_autogen.py b/experimental/PdfViewer/autogen/pdfspec_autogen.py
similarity index 91%
rename from experimental/PdfViewer/pdfspec_autogen.py
rename to experimental/PdfViewer/autogen/pdfspec_autogen.py
index 1c31384..9e1dbd9 100644
--- a/experimental/PdfViewer/pdfspec_autogen.py
+++ b/experimental/PdfViewer/autogen/pdfspec_autogen.py
@@ -1615,13 +1615,13 @@
       .optional()\
           .field('Matrix')\
           .name('Matrix')\
-          .type('array')\
+          .type('matrix')\
           .comment('(Optional) An array of six numbers specifying the form matrix, which maps\nform space into user space (see Section 4.2.3, "Transformation Matrices").\nDefault value: the identity matrix [1 0 0 1 0 0].')\
           .done().done()\
       .optional()\
           .field('Resources')\
           .name('Resources')\
-          .type('dictionary')\
+          .type('ResourceDictionary')\
           .comment('(Optional but strongly recommended; PDF 1.2) A dictionary specifying any\nresources (such as fonts and images) required by the form XObject (see Sec-\ntion 3.7, "Content Streams and Resources").\nIn PDF 1.1 and earlier, all named resources used in the form XObject must be\nincluded in the resource dictionary of each page object on which the form\nXObject appears, whether or not they also appear in the resource dictionary\nof the form XObject itself. It can be useful to specify these resources in the\nform XObject\'s own resource dictionary as well, in order to determine which\nresources are used inside the form XObject. If a resource is included in both\ndictionaries, it should have the same name in both locations.\n     In PDF 1.2 and later versions, form XObjects can be independent of the\n     content streams in which they appear, and this is strongly recommended\n     although not required. In an independent form XObject, the resource dic-\n     tionary of the form XObject is required and contains all named resources\n     used by the form XObject. These resources are not "promoted" to the outer\n     content stream\'s resource dictionary, although that stream\'s resource diction-\n     ary will refer to the form XObject itself.')\
           .done().done()\
       .optional()\
@@ -1789,7 +1789,7 @@
           .done().done()\
       .done()
 
-  pdfspec.addClass('Type3FontDictionary', 'Type0FontDictionary', 'Entries in a Type 3 font dictionary')\
+  pdfspec.addClass('Type3FontDictionary', 'Type1FontDictionary', 'Entries in a Type 3 font dictionary')\
       .required('NULL')\
           .field('Type')\
           .name('Type')\
@@ -1818,8 +1818,50 @@
       .required('NULL')\
           .field('FontMatrix')\
           .name('FontMatrix')\
+          .type('matrix')\
+          .comment('(Required) An array of six numbers specifying the font matrix, mapping\nglyph space to text space (see Section 5.1.3, "Glyph Positioning and\nMetrics"). A common practice is to define glyphs in terms of a 1000-unit\nglyph     coordinate      system,     in    which    case the font    matrix    is\n[0.001 0 0 0.001 0 0].')\
+          .done().done()\
+      .required('NULL')\
+          .field('CharProcs')\
+          .name('CharProcs')\
+          .type('dictionary')\
+          .comment('(Required) A dictionary in which each key is a character name and the value\nassociated with that key is a content stream that constructs and paints the\nglyph for that character. The stream must include as its first operator either\nd0 or d1. This is followed by operators describing one or more graphics\nobjects, which may include path, text, or image objects. See below for more\ndetails about Type 3 glyph descriptions.')\
+          .done().done()\
+      .required('NULL')\
+          .field('Encoding')\
+          .name('Encoding')\
+          .type('name or EncodingDictionary')\
+          .comment('(Required) An encoding dictionary whose Differences array specifies the\ncomplete character encoding for this font (see Section 5.5.5, "Character\nEncoding"; also see implementation note 46 in Appendix H).')\
+          .done().done()\
+      .required('NULL')\
+          .field('FirstChar')\
+          .name('FirstChar')\
+          .type('integer')\
+          .comment('(Required) The first character code defined in the font\'s Widths array.')\
+          .done().done()\
+      .required('NULL')\
+          .field('LastChar')\
+          .name('LastChar')\
+          .type('integer')\
+          .comment('(Required) The last character code defined in the font\'s Widths array.')\
+          .done().done()\
+      .optional()\
+          .field('Widths')\
+          .name('Widths')\
           .type('array')\
-          .comment('(Required) An array of six numbers specifying the font matrix, mapping\nglyph space to text space (see Section 5.1.3, "Glyph Positioning and\nMetrics"). A common practice is to define glyphs in terms of a 1000-unit')\
+          .comment('(Required; indirect reference preferred) An array of (LastChar - FirstChar + 1)\nwidths, each element being the glyph width for the character whose code is\nFirstChar plus the array index. For character codes outside the range FirstChar\nto LastChar, the width is 0. These widths are interpreted in glyph space as\nspecified by FontMatrix (unlike the widths of a Type 1 font, which are in\nthousandths of a unit of text space).\nNote: If FontMatrix specifies a rotation, only the horizontal component of the\ntransformed width is used. That is, the resulting displacement is always horizon-\ntal in text space, as is the case for all simple fonts.')\
+          .done().done()\
+      .optional()\
+          .field('Resources')\
+          .name('Resources')\
+          .type('dictionary')\
+          .comment('(Optional but strongly recommended; PDF 1.2) A list of the named resources,\nsuch as fonts and images, required by the glyph descriptions in this font (see\nSection 3.7.2, "Resource Dictionaries"). If any glyph descriptions refer to\nnamed resources but this dictionary is absent, the names are looked up in the\nresource dictionary of the page on which the font is used. (See implementa-\ntion note 47 in Appendix H.)')\
+          .done().done()\
+      .optional()\
+          .field('ToUnicode')\
+          .name('ToUnicode')\
+          .type('stream')\
+          .comment('(Optional; PDF 1.2) A stream containing a CMap file that maps character\ncodes to Unicode values (see Section 5.9, "ToUnicode CMaps").')\
           .done().done()\
       .done()
 
@@ -1840,7 +1882,7 @@
           .field('Differences')\
           .name('Differences')\
           .type('array')\
-          .comment('(Optional; not recommended with TrueType fonts) An array describing the differ-\nences from the encoding specified by BaseEncoding or, if BaseEncoding is ab-\nsent, from an implicit base encoding. The Differences array is described above.')\
+          .comment('(Optional; not recommended with TrueType fonts) An array describing the differ-\nences from the encoding specified by BaseEncoding or, if BaseEncoding is ab-\nsent, from an implicit base encoding. The Differences array is described above.\n   The value of the Differences entry is an array of character codes and character\n   names organized as follows:\n        code1 name1,1 name1,2 ...\n        code2 name2,1 name2,2 ...\n        ...\n        coden namen,1 namen,2 ...\n   Each code is the first index in a sequence of characters to be changed. The first\n   character name after the code becomes the name corresponding to that code.\n   Subsequent names replace consecutive code indices until the next code appears in\n   the array or the array ends. These sequences may be specified in any order but\n   should not overlap.\n   For example, in the encoding dictionary in Example 5.10, the name quotesingle\n   ( \' ) is associated with character code 39, Adieresis (A) with code 128, Aring (A)\n   with 129, and trademark ((TM)) with 170.')\
           .done().done()\
       .done()
 
@@ -5369,3 +5411,169 @@
       .done()
 
 
+def addDictionaryTypesTo(knowTypes):
+  knowTypes['GoToActionDictionary'] = ['SkPdfGoToActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['SoundObjectDictionary'] = ['SkPdfSoundObjectDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['LaunchActionDictionary'] = ['SkPdfLaunchActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['RemoteGoToActionDictionary'] = ['SkPdfRemoteGoToActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['PageObjectActionsDictionary'] = ['SkPdfPageObjectActionsDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['AnnotationActionsDictionary'] = ['SkPdfAnnotationActionsDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['DocumentCatalogActionsDictionary'] = ['SkPdfDocumentCatalogActionsDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FormFieldActionsDictionary'] = ['SkPdfFormFieldActionsDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['JavascriptDictionary'] = ['SkPdfJavascriptDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['EncryptedEmbeddedFileStreamDictionary'] = ['SkPdfEncryptedEmbeddedFileStreamDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['IconFitDictionary'] = ['SkPdfIconFitDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FDFFieldDictionary'] = ['SkPdfFDFFieldDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ThreadActionDictionary'] = ['SkPdfThreadActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['WindowsLaunchActionDictionary'] = ['SkPdfWindowsLaunchActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FileAttachmentAnnotationDictionary'] = ['SkPdfFileAttachmentAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FDFNamedPageReferenceDictionary'] = ['SkPdfFDFNamedPageReferenceDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FileTrailerDictionary'] = ['SkPdfFileTrailerDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['EncryptionCommonDictionary'] = ['SkPdfEncryptionCommonDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Jbig2DecodeFilterDictionary'] = ['SkPdfJbig2DecodeFilterDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['DctdecodeFilterDictionary'] = ['SkPdfDctdecodeFilterDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['CatalogDictionary'] = ['SkPdfCatalogDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['PageTreeNodeDictionary'] = ['SkPdfPageTreeNodeDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['StandardSecurityHandlerDictionary'] = ['SkPdfStandardSecurityHandlerDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['PageObjectDictionary'] = ['SkPdfPageObjectDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['NameDictionary'] = ['SkPdfNameDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['VariableTextFieldDictionary'] = ['SkPdfVariableTextFieldDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ObjectReferenceDictionary'] = ['SkPdfObjectReferenceDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['TrapNetworkAppearanceStreamDictionary'] = ['SkPdfTrapNetworkAppearanceStreamDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ImageDictionary'] = ['SkPdfImageDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['OpiVersionDictionary'] = ['SkPdfOpiVersionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type1FontDictionary'] = ['SkPdfType1FontDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type3FontDictionary'] = ['SkPdfType3FontDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['EncodingDictionary'] = ['SkPdfEncodingDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['CIDSystemInfoDictionary'] = ['SkPdfCIDSystemInfoDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['CIDFontDictionary'] = ['SkPdfCIDFontDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['CMapDictionary'] = ['SkPdfCMapDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type0FontDictionary'] = ['SkPdfType0FontDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FontDescriptorDictionary'] = ['SkPdfFontDescriptorDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ResetFormActionDictionary'] = ['SkPdfResetFormActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FDFPageDictionary'] = ['SkPdfFDFPageDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ChoiceFieldDictionary'] = ['SkPdfChoiceFieldDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['StructureElementAccessDictionary'] = ['SkPdfStructureElementAccessDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['CalgrayColorSpaceDictionary'] = ['SkPdfCalgrayColorSpaceDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['WebCaptureCommandDictionary'] = ['SkPdfWebCaptureCommandDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['IccProfileStreamDictionary'] = ['SkPdfIccProfileStreamDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['LabColorSpaceDictionary'] = ['SkPdfLabColorSpaceDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['CalrgbColorSpaceDictionary'] = ['SkPdfCalrgbColorSpaceDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['HideActionDictionary'] = ['SkPdfHideActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FDFTemplateDictionary'] = ['SkPdfFDFTemplateDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['NamedActionsDictionary'] = ['SkPdfNamedActionsDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['InteractiveFormDictionary'] = ['SkPdfInteractiveFormDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['URIActionDictionary'] = ['SkPdfURIActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['URIDictionary'] = ['SkPdfURIDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['SoundActionDictionary'] = ['SkPdfSoundActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['MovieActionDictionary'] = ['SkPdfMovieActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['SourceInformationDictionary'] = ['SkPdfSourceInformationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FDFFileAnnotationDictionary'] = ['SkPdfFDFFileAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['TransitionDictionary'] = ['SkPdfTransitionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['BeadDictionary'] = ['SkPdfBeadDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ThreadDictionary'] = ['SkPdfThreadDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['PageLabelDictionary'] = ['SkPdfPageLabelDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['OutlineItemDictionary'] = ['SkPdfOutlineItemDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['OutlineDictionary'] = ['SkPdfOutlineDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ViewerPreferencesDictionary'] = ['SkPdfViewerPreferencesDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['MarkInformationDictionary'] = ['SkPdfMarkInformationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['URLAliasDictionary'] = ['SkPdfURLAliasDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['WebCaptureDictionary'] = ['SkPdfWebCaptureDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['AttributeObjectDictionary'] = ['SkPdfAttributeObjectDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ArtifactsDictionary'] = ['SkPdfArtifactsDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['WebCaptureInformationDictionary'] = ['SkPdfWebCaptureInformationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['TrapNetworkAnnotationDictionary'] = ['SkPdfTrapNetworkAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type1FormDictionary'] = ['SkPdfType1FormDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['GroupAttributesDictionary'] = ['SkPdfGroupAttributesDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ReferenceDictionary'] = ['SkPdfReferenceDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['PSXobjectDictionary'] = ['SkPdfPSXobjectDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['BoxStyleDictionary'] = ['SkPdfBoxStyleDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['BoxColorInformationDictionary'] = ['SkPdfBoxColorInformationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['WebCaptureCommandSettingsDictionary'] = ['SkPdfWebCaptureCommandSettingsDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['InlineLevelStructureElementsDictionary'] = ['SkPdfInlineLevelStructureElementsDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['AppearanceCharacteristicsDictionary'] = ['SkPdfAppearanceCharacteristicsDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type3ShadingDictionary'] = ['SkPdfType3ShadingDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type4ShadingDictionary'] = ['SkPdfType4ShadingDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['TextFieldDictionary'] = ['SkPdfTextFieldDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['RadioButtonFieldDictionary'] = ['SkPdfRadioButtonFieldDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['CheckboxFieldDictionary'] = ['SkPdfCheckboxFieldDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type1PatternDictionary'] = ['SkPdfType1PatternDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type2PatternDictionary'] = ['SkPdfType2PatternDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['DeviceNColorSpaceDictionary'] = ['SkPdfDeviceNColorSpaceDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type1ShadingDictionary'] = ['SkPdfType1ShadingDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type2ShadingDictionary'] = ['SkPdfType2ShadingDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['StandardStructureDictionary'] = ['SkPdfStandardStructureDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ShadingDictionary'] = ['SkPdfShadingDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['EmbeddedFileParameterDictionary'] = ['SkPdfEmbeddedFileParameterDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['MacOsFileInformationDictionary'] = ['SkPdfMacOsFileInformationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['WebCaptureImageSetDictionary'] = ['SkPdfWebCaptureImageSetDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['GraphicsStateDictionary'] = ['SkPdfGraphicsStateDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FileSpecificationDictionary'] = ['SkPdfFileSpecificationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['EmbeddedFileStreamDictionary'] = ['SkPdfEmbeddedFileStreamDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['MovieDictionary'] = ['SkPdfMovieDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FieldDictionary'] = ['SkPdfFieldDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['MovieActivationDictionary'] = ['SkPdfMovieActivationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['TableAttributesDictionary'] = ['SkPdfTableAttributesDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ListAttributeDictionary'] = ['SkPdfListAttributeDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['SeparationDictionary'] = ['SkPdfSeparationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['BlockLevelStructureElementsDictionary'] = ['SkPdfBlockLevelStructureElementsDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FDFCatalogDictionary'] = ['SkPdfFDFCatalogDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type1HalftoneDictionary'] = ['SkPdfType1HalftoneDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type10HalftoneDictionary'] = ['SkPdfType10HalftoneDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type6HalftoneDictionary'] = ['SkPdfType6HalftoneDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type5HalftoneDictionary'] = ['SkPdfType5HalftoneDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type16HalftoneDictionary'] = ['SkPdfType16HalftoneDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type6ShadingDictionary'] = ['SkPdfType6ShadingDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['StreamCommonDictionary'] = ['SkPdfStreamCommonDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FDFDictionary'] = ['SkPdfFDFDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['LzwdecodeAndFlatedecodeFiltersDictionary'] = ['SkPdfLzwdecodeAndFlatedecodeFiltersDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['CcittfaxdecodeFilterDictionary'] = ['SkPdfCcittfaxdecodeFilterDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['MarkedContentReferenceDictionary'] = ['SkPdfMarkedContentReferenceDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['SignatureDictionary'] = ['SkPdfSignatureDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['SoundAnnotationDictionary'] = ['SkPdfSoundAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['MovieAnnotationDictionary'] = ['SkPdfMovieAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type3FunctionDictionary'] = ['SkPdfType3FunctionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type2FunctionDictionary'] = ['SkPdfType2FunctionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['RubberStampAnnotationDictionary'] = ['SkPdfRubberStampAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['InkAnnotationDictionary'] = ['SkPdfInkAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['SquareOrCircleAnnotation'] = ['SkPdfSquareOrCircleAnnotation*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['MarkupAnnotationsDictionary'] = ['SkPdfMarkupAnnotationsDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['NameTreeNodeDictionary'] = ['SkPdfNameTreeNodeDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type5ShadingDictionary'] = ['SkPdfType5ShadingDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ResourceDictionary'] = ['SkPdfResourceDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['SubmitFormActionDictionary'] = ['SkPdfSubmitFormActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['Type0FunctionDictionary'] = ['SkPdfType0FunctionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FunctionCommonDictionary'] = ['SkPdfFunctionCommonDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['NumberTreeNodeDictionary'] = ['SkPdfNumberTreeNodeDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ActionDictionary'] = ['SkPdfActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['WidgetAnnotationDictionary'] = ['SkPdfWidgetAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['StructureTreeRootDictionary'] = ['SkPdfStructureTreeRootDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['JavascriptActionDictionary'] = ['SkPdfJavascriptActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['AlternateImageDictionary'] = ['SkPdfAlternateImageDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['PDF_XOutputIntentDictionary'] = ['SkPdfPDF_XOutputIntentDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['DocumentInformationDictionary'] = ['SkPdfDocumentInformationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['MetadataStreamDictionary'] = ['SkPdfMetadataStreamDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ImportDataActionDictionary'] = ['SkPdfImportDataActionDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['PagePieceDictionary'] = ['SkPdfPagePieceDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ApplicationDataDictionary'] = ['SkPdfApplicationDataDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ComponentsWithMetadataDictionary'] = ['SkPdfComponentsWithMetadataDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['PrinterMarkFormDictionary'] = ['SkPdfPrinterMarkFormDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['StructureElementDictionary'] = ['SkPdfStructureElementDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['PrinterMarkAnnotationDictionary'] = ['SkPdfPrinterMarkAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['SoftMaskImageDictionary'] = ['SkPdfSoftMaskImageDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['TransparencyGroupDictionary'] = ['SkPdfTransparencyGroupDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['SoftMaskDictionary'] = ['SkPdfSoftMaskDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['BorderStyleDictionary'] = ['SkPdfBorderStyleDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['PopUpAnnotationDictionary'] = ['SkPdfPopUpAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FDFTrailerDictionary'] = ['SkPdfFDFTrailerDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['LineAnnotationDictionary'] = ['SkPdfLineAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['FreeTextAnnotationDictionary'] = ['SkPdfFreeTextAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['ALinkAnnotationDictionary'] = ['SkPdfALinkAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['TextAnnotationDictionary'] = ['SkPdfTextAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['WebCapturePageSetDictionary'] = ['SkPdfWebCapturePageSetDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['AppearanceDictionary'] = ['SkPdfAppearanceDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['CIDFontDescriptorDictionary'] = ['SkPdfCIDFontDescriptorDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['EmbeddedFontStreamDictionary'] = ['SkPdfEmbeddedFontStreamDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+  knowTypes['AnnotationDictionary'] = ['SkPdfAnnotationDictionary*', 'DictionaryFromDictionary2', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary']
+
+
diff --git a/experimental/PdfViewer/generate_code.py b/experimental/PdfViewer/generate_code.py
index f128e44..02736d3 100644
--- a/experimental/PdfViewer/generate_code.py
+++ b/experimental/PdfViewer/generate_code.py
@@ -3,13 +3,13 @@
 import sys
 
 import datatypes
-import pdfspec_autogen
+from autogen.pdfspec_autogen import *
 
 knowTypes = {
 '(any)': ['SkPdfObject*', 'ObjectFromDictionary', datatypes.CppNull(), 'true'],
 '(undefined)': ['SkPdfObject*', 'ObjectFromDictionary', datatypes.CppNull(), 'true'],
 '(various)': ['SkPdfObject*', 'ObjectFromDictionary', datatypes.CppNull(), 'true'],
-'array': ['SkPdfArray', 'ArrayFromDictionary', datatypes.PdfArrayNone(), 'ret->podofo()->GetDataType() == ePdfDataType_Array'],
+'array': ['SkPdfArray*', 'ArrayFromDictionary', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Array'],
 'boolean': ['bool', 'BoolFromDictionary', datatypes.PdfBoolean('false'), 'ret->podofo()->GetDataType() == ePdfDataType_Bool'],
 'date': ['SkPdfDate', 'DateFromDictionary', datatypes.PdfDateNever(), 'ret->podofo()->GetDataType() == ePdfDataType_Array'],
 'dictionary': ['SkPdfDictionary*', 'DictionaryFromDictionary', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Dictionary'],
@@ -19,11 +19,12 @@
 'name': ['std::string', 'NameFromDictionary', datatypes.PdfString('""'), 'ret->podofo()->GetDataType() == ePdfDataType_Name'],
 'tree': ['SkPdfTree*', 'TreeFromDictionary', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Reference'],
 'number': ['double', 'DoubleFromDictionary', datatypes.PdfNumber(0), 'ret->podofo()->GetDataType() == ePdfDataType_Real || ret->podofo()->GetDataType() == ePdfDataType_Number'],
-'rectangle': ['SkRect', 'SkRectFromDictionary', datatypes.PdfEmptyRect(), 'ret->podofo()->GetDataType() == ePdfDataType_Array'],
+'rectangle': ['SkRect*', 'SkRectFromDictionary', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Array && ret->podofo()->GetArray().GetLength() == 4'],
 'stream': ['SkPdfStream*', 'StreamFromDictionary',  datatypes.CppNull(), 'ret->podofo()->HasStream()'],
 'string': ['std::string', 'StringFromDictionary', datatypes.PdfString('""'), 'ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()->GetDataType() == ePdfDataType_HexString'],
 'text': ['std::string', 'StringFromDictionary', datatypes.PdfString('""'), 'ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()->GetDataType() == ePdfDataType_HexString'],
 'text string': ['std::string', 'StringFromDictionary', datatypes.PdfString('""'), 'ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()->GetDataType() == ePdfDataType_HexString'],
+'matrix': ['SkMatrix*', 'SkMatrixFromDictionary', datatypes.CppNull(), 'ret->podofo()->GetDataType() == ePdfDataType_Array && ret->podofo()->GetArray().GetLength() == 4'],
 }
 
 
@@ -289,6 +290,7 @@
       fileClass.write('#define __DEFINED__SkPdf' + cls.fName + '\n')
       fileClass.write('\n')
 
+      fileClass.write('#include "SkPdfUtils.h"\n')
       fileClass.write('#include "SkPdfEnums_autogen.h"\n')
       fileClass.write('#include "SkPdfArray_autogen.h"\n')
       if cls.fBase != '':
@@ -327,12 +329,17 @@
         fileClass.write('\n')
         fileClass.write('public:\n')
         fileClass.write('  SkPdf' + cls.fName + '(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : fPodofoDoc(podofoDoc), fPodofoObj(podofoObj) {}\n')
+        fileClass.write('  SkPdf' + cls.fName + '(const SkPdf' + cls.fName + '& from) : fPodofoDoc(from.fPodofoDoc), fPodofoObj(from.fPodofoObj) {}\n')
+        fileClass.write('\n')
         fileClass.write('  const PdfMemDocument* doc() const { return fPodofoDoc;}\n')
         fileClass.write('  const PdfObject* podofo() const { return fPodofoObj;}\n')
       else:
         fileClass.write('public:\n')
         fileClass.write('  SkPdf' + cls.fName + '(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdf' + cls.fBase + '(podofoDoc, podofoObj) {}\n')
         fileClass.write('\n')
+        fileClass.write('  SkPdf' + cls.fName + '(const SkPdf' + cls.fName + '& from) : SkPdf' + cls.fBase + '(from.fPodofoDoc, from.fPodofoObj) {}\n')
+        fileClass.write('\n')
+      
       
       #check required fieds, also, there should be an internal_valid() manually wrote for complex
       # situations
@@ -497,6 +504,7 @@
 
 def generateCode():
   global fileHeaders 
+  global knowTypes
 
   fileHeaders = open('SkPdfHeaders_autogen.h', 'w')
   fileHeaders.write('#ifndef __DEFINED__SkPdfHeaders\n')
@@ -535,8 +543,8 @@
                              .carbonCopyPublic('const std::string& value() const {return fPodofoObj->GetString().GetStringUtf8();}')
   
   manager.addClass('Dictionary').check('podofoObj.GetDataType() == ePdfDataType_Dictionary')\
-                                .carbonCopyPublic('const SkPdfObject get(const char* dictionaryKeyName) const {return SkPdfObject(fPodofoDoc, resolveReferenceObject(fPodofoDoc, fPodofoObj->GetDictionary().GetKey(PdfName(dictionaryKeyName))));}')\
-                                .carbonCopyPublic('SkPdfObject get(const char* dictionaryKeyName) {return SkPdfObject(fPodofoDoc, resolveReferenceObject(fPodofoDoc, fPodofoObj->GetDictionary().GetKey(PdfName(dictionaryKeyName))));}')\
+                                .carbonCopyPublic('SkPdfObject* get(const char* dictionaryKeyName) const {return new SkPdfObject(fPodofoDoc, resolveReferenceObject(fPodofoDoc, fPodofoObj->GetDictionary().GetKey(PdfName(dictionaryKeyName))));}')\
+                                .carbonCopyPublic('SkPdfObject* get(const char* dictionaryKeyName) {return new SkPdfObject(fPodofoDoc, resolveReferenceObject(fPodofoDoc, fPodofoObj->GetDictionary().GetKey(PdfName(dictionaryKeyName))));}')\
 
   manager.addClass('Stream')  # attached to a dictionary in podofo
   
@@ -555,7 +563,9 @@
           .must([datatypes.PdfName('TrueType')])\
           .done().done()\
   
-  pdfspec_autogen.buildPdfSpec(manager)  
+  
+  addDictionaryTypesTo(knowTypes)
+  buildPdfSpec(manager)  
 
   manager.addClass('MultiMasterFontDictionary', 'Type1FontDictionary')\
           .required('NULL')\
diff --git a/experimental/PdfViewer/pdf_viewer_main.cpp b/experimental/PdfViewer/pdf_viewer_main.cpp
index 877849e..61997fa 100644
--- a/experimental/PdfViewer/pdf_viewer_main.cpp
+++ b/experimental/PdfViewer/pdf_viewer_main.cpp
@@ -28,174 +28,32 @@
 
 __SK_FORCE_IMAGE_DECODER_LINKING;
 
+// TODO(edisonn): tool, show what objects were read at least, show the ones not even read
+// keep for each object pos in file
+// plug in for VS? syntax coloring, show selected object ... from the text, or from rendered x,y
 
-//#define PDF_TRACE
-//#define PDF_TRACE_DIFF_IN_PNG
-//#define PDF_DEBUG_NO_CLIPING
-//#define PDF_DEBUG_NO_PAGE_CLIPING
-//#define PDF_DEBUG_3X
+// TODO(edisonn): security - validate all the user input, all pdf!
 
 
-const PdfObject* resolveReferenceObject(const PdfMemDocument* pdfDoc,
-                                  const PdfObject* obj,
-                                  bool resolveOneElementArrays = false);
-
-bool LongFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        long* data);
-
-bool DoubleFromDictionary(const PdfMemDocument* pdfDoc,
-                          const PdfDictionary& dict,
-                          const char* key,
-                          const char* abr,
-                          double* data);
-
-bool BoolFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        bool* data);
-
-bool NameFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        std::string* data);
-
-bool StringFromDictionary(const PdfMemDocument* pdfDoc,
-                          const PdfDictionary& dict,
-                          const char* key,
-                          const char* abr,
-                          std::string* data);
-
-class SkPdfDictionary;
-bool DictionaryFromDictionary(const PdfMemDocument* pdfDoc,
-                              const PdfDictionary& dict,
-                              const char* key,
-                              const char* abr,
-                              SkPdfDictionary** data);
-
-template <typename T>
-bool DictionaryFromDictionary2(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        T** data);
-
-class SkPdfObject;
-bool ObjectFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfObject** data);
-
-
-struct SkPdfFileSpec {};
-class SkPdfArray;
-class SkPdfStream;
-struct SkPdfDate {};
-struct SkPdfTree {};
-struct SkPdfFunction {};
-
-bool ArrayFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfArray* data);
-
-
-bool FileSpecFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfFileSpec* data);
-
-
-bool StreamFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfStream** data);
-
-bool TreeFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfTree** data);
-
-bool DateFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfDate* data);
-
-bool SkRectFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkRect* data);
-
-bool FunctionFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfFunction* data);
-
-bool skpdfmap(const PdfMemDocument& podofoDoc, const PdfObject& podofoObj, SkPdfObject** out);
-
 #include "SkPdfHeaders_autogen.h"
 #include "SkPdfPodofoMapper_autogen.h"
 #include "SkPdfParser.h"
+
+#include "SkPdfBasics.h"
+#include "SkPdfUtils.h"
+
 #include "SkPdfFont.h"
 
 // TODO(edisonn): fix the mess with the files.
 #include "SkPdfFont.cpp"
+#include "SkPdfBasics.cpp"
+#include "SkPdfUtils.cpp"
 
 bool skpdfmap(const PdfMemDocument& podofoDoc, const PdfObject& podofoObj, SkPdfObject** out) {
     return PodofoMapper::map(podofoDoc, podofoObj, out);
 }
 
 
-bool ArrayFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfArray* data) {return false;}
-
-bool FileSpecFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfFileSpec* data) {return false;}
-
-bool StreamFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfStream** data);
-
-bool TreeFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfTree** data) {return false;}
-
-bool DateFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfDate* data) {return false;}
-
-bool FunctionFromDictionary(const PdfMemDocument* pdfDoc,
-                        const PdfDictionary& dict,
-                        const char* key,
-                        const char* abr,
-                        SkPdfFunction* data) {return false;}
-
-
-
 /*
  * TODO(edisonn):
  * - all font types and all ppdf font features
@@ -224,8 +82,19 @@
     }
     printf("\n");
 }
+
+static void SkTraceRect(const SkRect& rect, const char* sz = "") {
+    printf("SkRect %s ", sz);
+    printf("x = %f ", SkScalarToDouble(rect.x()));
+    printf("y = %f ", SkScalarToDouble(rect.y()));
+    printf("w = %f ", SkScalarToDouble(rect.width()));
+    printf("h = %f ", SkScalarToDouble(rect.height()));
+    printf("\n");
+}
+
 #else
 #define SkTraceMatrix(a,b)
+#define SkTraceRect(a,b)
 #endif
 
 using namespace std;
@@ -289,125 +158,20 @@
     return matrix;
 }
 
-// TODO(edisonn): better class design.
-struct PdfColorOperator {
-    std::string fColorSpace;  // TODO(edisonn): use SkString
-    SkColor fColor;
-    double fOpacity;  // ca or CA
-    // TODO(edisonn): add here other color space options.
+SkMatrix SkMatrixFromPdfArray(SkPdfArray* pdfArray) {
+    double array[6];
 
-    void setRGBColor(SkColor color) {
-        // TODO(edisonn): ASSERT DeviceRGB is the color space.
-        fColor = color;
-    }
-    // TODO(edisonn): double check the default values for all fields.
-    PdfColorOperator() : fColor(SK_ColorBLACK), fOpacity(1) {}
-
-    void applyGraphicsState(SkPaint* paint) {
-        paint->setColor(SkColorSetA(fColor, fOpacity * 255));
-    }
-
-};
-
-// TODO(edisonn): better class design.
-struct PdfGraphicsState {
-    SkMatrix            fMatrix;
-    SkMatrix            fMatrixTm;
-    SkMatrix            fMatrixTlm;
-
-    double              fCurPosX;
-    double              fCurPosY;
-
-    double              fCurFontSize;
-    bool                fTextBlock;
-    PdfFont*            fCurFont;
-    SkPdfFont*          fSkFont;
-    SkPath              fPath;
-    bool                fPathClosed;
-
-    // Clip that is applied after the drawing is done!!!
-    bool                fHasClipPathToApply;
-    SkPath              fClipPath;
-
-    PdfColorOperator    fStroking;
-    PdfColorOperator    fNonStroking;
-
-    double              fLineWidth;
-    double              fTextLeading;
-    double              fWordSpace;
-    double              fCharSpace;
-
-    SkPdfResourceDictionary* fResources;
-
-    SkBitmap            fSMask;
-
-    PdfGraphicsState() {
-        fCurPosX      = 0.0;
-        fCurPosY      = 0.0;
-        fCurFontSize  = 0.0;
-        fTextBlock    = false;
-        fCurFont      = NULL;
-        fMatrix       = SkMatrix::I();
-        fMatrixTm     = SkMatrix::I();
-        fMatrixTlm    = SkMatrix::I();
-        fPathClosed   = true;
-        fLineWidth    = 0;
-        fTextLeading  = 0;
-        fWordSpace    = 0;
-        fCharSpace    = 0;
-        fHasClipPathToApply = false;
-        fResources    = NULL;
-        fSkFont       = NULL;
-    }
-
-    void applyGraphicsState(SkPaint* paint, bool stroking) {
-        if (stroking) {
-            fStroking.applyGraphicsState(paint);
-        } else {
-            fNonStroking.applyGraphicsState(paint);
+    // TODO(edisonn): security issue, ret if size() != 6
+    for (int i = 0; i < 6; i++) {
+        const PdfObject* elem = resolveReferenceObject(pdfArray->doc(), (*pdfArray)[i]->podofo());
+        if (elem == NULL || (!elem->IsReal() && !elem->IsNumber())) {
+            return SkMatrix::I();  // TODO(edisonn): report issue
         }
-
-        // TODO(edisonn): get this from pdfContext->options,
-        // or pdfContext->addPaintOptions(&paint);
-        paint->setAntiAlias(true);
-
-        // TODO(edisonn): dashing, miter, ...
-        paint->setStrokeWidth(SkDoubleToScalar(fLineWidth));
+        array[i] = elem->GetReal();
     }
-};
 
-// TODO(edisonn): better class design.
-struct PdfInlineImage {
-    std::map<std::string, std::string> fKeyValuePairs;
-    std::string fImageData;
-
-};
-
-// TODO(edisonn): better class design.
-struct PdfContext {
-    std::stack<SkPdfObject*>        fObjectStack;
-    std::stack<PdfGraphicsState>    fStateStack;
-    PdfGraphicsState                fGraphicsState;
-    SkPdfDoc&                       fPdfDoc;
-    SkMatrix                        fOriginalMatrix;
-
-    PdfInlineImage                  fInlineImage;
-
-    PdfContext(SkPdfDoc& doc) :  fPdfDoc(doc) {}
-
-};
-
-//  TODO(edisonn): temporary code, to report how much of the PDF we actually think we rendered.
-enum PdfResult {
-    kOK_PdfResult,
-    kPartial_PdfResult,
-    kNYI_PdfResult,
-    kIgnoreError_PdfResult,
-    kError_PdfResult,
-    kUnsupported_PdfResult,
-
-    kCount_PdfResult
-};
+    return SkMatrixFromPdfMatrix(array);
+}
 
 PdfContext* gPdfContext = NULL;
 SkBitmap* gDumpBitmap = NULL;
@@ -651,29 +415,6 @@
                                   (font->IsItalic() ? SkTypeface::kItalic : 0)));
 }
 
-
-// TODO(edisonn): move this code in podofo, so we don't have to fix the font.
-// This logic needs to be moved in PdfEncodingObjectFactory::CreateEncoding
-std::map<PdfFont*, PdfCMapEncoding*> gFontsFixed;
-PdfEncoding* FixPdfFont(PdfContext* pdfContext, PdfFont* fCurFont) {
-    // TODO(edisonn): and is Identity-H
-    if (gFontsFixed.find(fCurFont) == gFontsFixed.end()) {
-        if (fCurFont->GetObject()->IsDictionary() && fCurFont->GetObject()->GetDictionary().HasKey(PdfName("ToUnicode"))) {
-            PdfCMapEncoding* enc = new PdfCMapEncoding(
-                    fCurFont->GetObject(),
-                    (PdfObject*)resolveReferenceObject(&pdfContext->fPdfDoc.podofo(),
-                                           fCurFont->GetObject()->GetDictionary().GetKey(PdfName("ToUnicode"))),
-                    PdfCMapEncoding::eBaseEncoding_Identity);  // todo, read the base encoding
-            gFontsFixed[fCurFont] = enc;
-            return enc;
-        }
-
-        return NULL;
-    }
-
-    return gFontsFixed[fCurFont];
-}
-
 PdfResult DrawText(PdfContext* pdfContext,
                    const SkPdfObject* str,
                    SkCanvas* canvas)
@@ -687,10 +428,13 @@
     SkUnencodedText binary(str);
 
     SkDecodedText decoded;
-    skfont->encoding()->decodeText(binary, &decoded);
 
-    SkUnicodeText unicode;
-    skfont->ToUnicode(decoded, &unicode);
+    if (skfont->encoding() == NULL) {
+        // TODO(edisonn): report warning
+        return kNYI_PdfResult;
+    }
+
+    skfont->encoding()->decodeText(binary, &decoded);
 
     SkPaint paint;
     // TODO(edisonn): when should fCurFont->GetFontSize() used? When cur is fCurFontSize == 0?
@@ -727,155 +471,9 @@
     SkTraceMatrix(matrix, "mirrored");
 #endif
 
-    skfont->drawText(unicode, &paint, canvas, &pdfContext->fGraphicsState.fMatrixTm);
+    skfont->drawText(decoded, &paint, pdfContext, canvas, &pdfContext->fGraphicsState.fMatrixTm);
     canvas->restore();
 
-/*
-    PdfString& rString = str->podofo()->GetString();
-
-    //pdfContext->fGraphicsState.fSkFont->GetDecoding()->ToUnicode(rString);
-    //void* text;
-    //int len;
-    //SkPaint paint;
-    //pdfContext->fGraphicsState.fSkFont->drawText(text, len, paint, canvas, &pdfContext->fGraphicsState.fMatrixTm);
-
-    PdfFont* fCurFont = pdfContext->fGraphicsState.fCurFont;
-
-    if (!fCurFont)
-    {
-        // TODO(edisonn): ignore the error, use the default font?
-        // return kError_PdfResult;
-    }
-
-    const PdfEncoding* enc = fCurFont ? FixPdfFont(pdfContext, fCurFont) : NULL;
-    bool cMapUnicodeFont = enc != NULL;
-    if (!enc) enc = fCurFont ? fCurFont->GetEncoding() : NULL;
-    if (!enc)
-    {
-        // TODO(edisonn): Can we recover from this error?
-        //return kError_PdfResult;
-    }
-
-    PdfString r2 = rString;
-    PdfString unicode;
-
-    if (cMapUnicodeFont) {
-        r2 = PdfString((pdf_utf16be*)rString.GetString(), rString.GetLength() / 2);
-    }
-
-    unicode = enc ? enc->ConvertToUnicode( r2, fCurFont ) : r2.ToUnicode();
-
-#ifdef PDF_TRACE
-    printf("%i %i ? %c rString.len = %i\n", (int)rString.GetString()[0], (int)rString.GetString()[1], (int)rString.GetString()[1], rString.GetLength());
-    printf("%i %i %i %i %c unicode.len = %i\n", (int)unicode.GetString()[0], (int)unicode.GetString()[1], (int)unicode.GetString()[2], (int)unicode.GetString()[3], (int)unicode.GetString()[0], unicode.GetLength());
-#endif
-
-    SkPaint paint;
-    // TODO(edisonn): when should fCurFont->GetFontSize() used? When cur is fCurFontSize == 0?
-    // Or maybe just not call setTextSize at all?
-    if (pdfContext->fGraphicsState.fCurFontSize != 0) {
-        paint.setTextSize(SkDoubleToScalar(pdfContext->fGraphicsState.fCurFontSize));
-    }
-    if (fCurFont && fCurFont->GetFontScale() != 0) {
-        paint.setTextScaleX(SkFloatToScalar(fCurFont->GetFontScale() / 100.0));
-    }
-
-    pdfContext->fGraphicsState.applyGraphicsState(&paint, false);
-
-    paint.setTypeface(SkTypefaceFromPdfFont(fCurFont));
-
-    canvas->save();
-    SkMatrix matrix = pdfContext->fGraphicsState.fMatrixTm;
-
-#if 0
-    // Reverse now the space, otherwise the text is upside down.
-    SkScalar z = SkIntToScalar(0);
-    SkScalar one = SkIntToScalar(1);
-
-    SkPoint normalSpace1[4] = {SkPoint::Make(z, z), SkPoint::Make(one, z), SkPoint::Make(one, one), SkPoint::Make(z, one)};
-    SkPoint mirrorSpace1[4];
-    pdfContext->fGraphicsState.fMatrixTm.mapPoints(mirrorSpace1, normalSpace1, 4);
-
-    SkPoint normalSpace2[4] = {SkPoint::Make(z, z), SkPoint::Make(one, z), SkPoint::Make(one, -one), SkPoint::Make(z, -one)};
-    SkPoint mirrorSpace2[4];
-    pdfContext->fGraphicsState.fMatrixTm.mapPoints(mirrorSpace2, normalSpace2, 4);
-
-#ifdef PDF_TRACE
-    printf("mirror1[0], x = %f y = %f\n", SkScalarToDouble(mirrorSpace1[0].x()), SkScalarToDouble(mirrorSpace1[0].y()));
-    printf("mirror1[1], x = %f y = %f\n", SkScalarToDouble(mirrorSpace1[1].x()), SkScalarToDouble(mirrorSpace1[1].y()));
-    printf("mirror1[2], x = %f y = %f\n", SkScalarToDouble(mirrorSpace1[2].x()), SkScalarToDouble(mirrorSpace1[2].y()));
-    printf("mirror1[3], x = %f y = %f\n", SkScalarToDouble(mirrorSpace1[3].x()), SkScalarToDouble(mirrorSpace1[3].y()));
-    printf("mirror2[0], x = %f y = %f\n", SkScalarToDouble(mirrorSpace2[0].x()), SkScalarToDouble(mirrorSpace2[0].y()));
-    printf("mirror2[1], x = %f y = %f\n", SkScalarToDouble(mirrorSpace2[1].x()), SkScalarToDouble(mirrorSpace2[1].y()));
-    printf("mirror2[2], x = %f y = %f\n", SkScalarToDouble(mirrorSpace2[2].x()), SkScalarToDouble(mirrorSpace2[2].y()));
-    printf("mirror2[3], x = %f y = %f\n", SkScalarToDouble(mirrorSpace2[3].x()), SkScalarToDouble(mirrorSpace2[3].y()));
-#endif
-
-    SkMatrix mirror;
-    SkASSERT(mirror.setPolyToPoly(mirrorSpace1, mirrorSpace2, 4));
-
-    // TODO(edisonn): text positioning wrong right now. Need to get matrix operations right.
-    matrix.preConcat(mirror);
-    canvas->setMatrix(matrix);
-#endif
-
-    SkPoint point1;
-    pdfContext->fGraphicsState.fMatrixTm.mapXY(SkIntToScalar(0), SkIntToScalar(0), &point1);
-
-    SkMatrix mirror;
-    mirror.setTranslate(0, -point1.y());
-    // TODO(edisonn): fix rotated text, and skewed too
-    mirror.postScale(SK_Scalar1, -SK_Scalar1);
-    // TODO(edisonn): post rotate, skew
-    mirror.postTranslate(0, point1.y());
-
-    matrix.postConcat(mirror);
-
-    canvas->setMatrix(matrix);
-
-    SkTraceMatrix(matrix, "mirrored");
-
-#ifdef PDF_TRACE
-    SkPoint point;
-    pdfContext->fGraphicsState.fMatrixTm.mapXY(SkDoubleToScalar(0), SkDoubleToScalar(0), &point);
-    printf("Original SkCanvas resolved coordinates, x = %f y = %f\n", SkScalarToDouble(point.x()), SkScalarToDouble(point.y()));
-    matrix.mapXY(SkDoubleToScalar(0), SkDoubleToScalar(0), &point);
-    printf("Mirored SkCanvas resolved coordinates, x = %f y = %f\n", SkScalarToDouble(point.x()), SkScalarToDouble(point.y()));
-#endif
-
-    // TODO(edisonn): remove this call once we load the font properly
-    // The extra * will show that we got at least the text positioning right
-    // even if font failed to be loaded
-//    canvas->drawText(".", 1, SkDoubleToScalar(-5.0), SkDoubleToScalar(0.0), paint);
-
-
-
-    // TODO(edisonn): use character and word spacing .. add utility function
-    if (cMapUnicodeFont) {
-        paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);
-        SkScalar textWidth = paint.measureText(unicode.GetString(), unicode.GetLength());
-        pdfContext->fGraphicsState.fMatrixTm.preTranslate(textWidth, SkDoubleToScalar(0.0));
-        canvas->drawText(unicode.GetString(), unicode.GetLength(), SkDoubleToScalar(0.0), SkDoubleToScalar(0.0), paint);
-    }
-    else {
-        paint.setTextEncoding(SkPaint::kUTF8_TextEncoding);
-        SkScalar textWidth = paint.measureText(unicode.GetStringUtf8().c_str(), strlen(unicode.GetStringUtf8().c_str()));
-        pdfContext->fGraphicsState.fMatrixTm.preTranslate(textWidth, SkDoubleToScalar(0.0));
-        canvas->drawText(unicode.GetStringUtf8().c_str(), strlen(unicode.GetStringUtf8().c_str()), SkDoubleToScalar(0.0), SkDoubleToScalar(0.0), paint);
-    }
-
-//    paint.setTextEncoding(SkPaint::kUTF8_TextEncoding);
-//    unsigned char ch = *(unicode.GetString() + 3);
-//    if ((ch & 0xC0) != 0x80 && ch < 0x80) {
-//        printf("x%i", ch);
-//        SkScalar textWidth = paint.measureText(&ch, 1);
-//        pdfContext->fGraphicsState.fMatrixTm.preTranslate(textWidth, SkDoubleToScalar(0.0));
-//        canvas->drawText(&ch, 1, SkDoubleToScalar(0.0), SkDoubleToScalar(0.0), paint);
-//    }
-
-    canvas->restore();
-
-*/
     return kPartial_PdfResult;
 }
 
@@ -1028,6 +626,35 @@
     return StringFromDictionary(pdfDoc, dict, abr, data);
 }
 
+bool ArrayFromDictionary(const PdfMemDocument* pdfDoc,
+                              const PdfDictionary& dict,
+                              const char* key,
+                              SkPdfArray** data) {
+    const PdfObject* value = resolveReferenceObject(pdfDoc,
+                                              dict.GetKey(PdfName(key)),
+                                              true);
+    if (value == NULL || !value->IsArray()) {
+        return false;
+    }
+    if (data == NULL) {
+        return true;
+    }
+
+    return PodofoMapper::map(*pdfDoc, *value, (SkPdfObject**)data);
+}
+
+
+bool ArrayFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        SkPdfArray** data) {
+    if (ArrayFromDictionary(pdfDoc, dict, key, data)) return true;
+    if (abr == NULL || *abr == '\0') return false;
+    return ArrayFromDictionary(pdfDoc, dict, abr, data);
+}
+
+
 bool DictionaryFromDictionary(const PdfMemDocument* pdfDoc,
                               const PdfDictionary& dict,
                               const char* key,
@@ -1059,7 +686,7 @@
 bool DictionaryFromDictionary2(const PdfMemDocument* pdfDoc,
                               const PdfDictionary& dict,
                               const char* key,
-                              SkPdfDictionary** data) {
+                              T** data) {
     const PdfObject* value = resolveReferenceObject(pdfDoc,
                                               dict.GetKey(PdfName(key)),
                                               true);
@@ -1337,7 +964,7 @@
 }
 
 SkBitmap getSmaskFromObject(PdfContext* pdfContext, const SkPdfImageDictionary* obj) {
-    const PdfObject* sMask = resolveReferenceObject(&pdfContext->fPdfDoc.podofo(),
+    const PdfObject* sMask = resolveReferenceObject(&pdfContext->fPdfDoc->podofo(),
                                               obj->podofo()->GetDictionary().GetKey(PdfName("SMask")));
 
 #ifdef PDF_TRACE
@@ -1349,7 +976,7 @@
 #endif
 
     if (sMask) {
-        SkPdfImageDictionary skxobjmask(&pdfContext->fPdfDoc.podofo(), sMask);
+        SkPdfImageDictionary skxobjmask(&pdfContext->fPdfDoc->podofo(), sMask);
         return getImageFromObject(pdfContext, &skxobjmask, true);
     }
 
@@ -1386,11 +1013,11 @@
     return kPartial_PdfResult;
 }
 
-bool SkMatrixFromDictionary(PdfContext* pdfContext,
+bool SkMatrixFromDictionary(const PdfMemDocument* pdfDoc,
                             const PdfDictionary& dict,
                             const char* key,
-                            SkMatrix* matrix) {
-    const PdfObject* value = resolveReferenceObject(&pdfContext->fPdfDoc.podofo(),
+                            SkMatrix** matrix) {
+    const PdfObject* value = resolveReferenceObject(pdfDoc,
                                                     dict.GetKey(PdfName(key)));
 
     if (value == NULL || !value->IsArray()) {
@@ -1403,21 +1030,33 @@
 
     double array[6];
     for (int i = 0; i < 6; i++) {
-        const PdfObject* elem = resolveReferenceObject(&pdfContext->fPdfDoc.podofo(), &value->GetArray()[i]);
+        const PdfObject* elem = resolveReferenceObject(pdfDoc, &value->GetArray()[i]);
         if (elem == NULL || (!elem->IsReal() && !elem->IsNumber())) {
             return false;
         }
         array[i] = elem->GetReal();
     }
 
-    *matrix = SkMatrixFromPdfMatrix(array);
+    *matrix = new SkMatrix();
+    **matrix = SkMatrixFromPdfMatrix(array);
     return true;
 }
 
+bool SkMatrixFromDictionary(const PdfMemDocument* pdfDoc,
+                        const PdfDictionary& dict,
+                        const char* key,
+                        const char* abr,
+                        SkMatrix** data) {
+    if (SkMatrixFromDictionary(pdfDoc, dict, key, data)) return true;
+    if (abr == NULL || *abr == '\0') return false;
+    return SkMatrixFromDictionary(pdfDoc, dict, abr, data);
+
+}
+
 bool SkRectFromDictionary(const PdfMemDocument* pdfDoc,
                           const PdfDictionary& dict,
                           const char* key,
-                          SkRect* rect) {
+                          SkRect** rect) {
     const PdfObject* value = resolveReferenceObject(pdfDoc,
                                                     dict.GetKey(PdfName(key)));
 
@@ -1438,10 +1077,11 @@
         array[i] = elem->GetReal();
     }
 
-    *rect = SkRect::MakeLTRB(SkDoubleToScalar(array[0]),
-                             SkDoubleToScalar(array[1]),
-                             SkDoubleToScalar(array[2]),
-                             SkDoubleToScalar(array[3]));
+    *rect = new SkRect();
+    **rect = SkRect::MakeLTRB(SkDoubleToScalar(array[0]),
+                              SkDoubleToScalar(array[1]),
+                              SkDoubleToScalar(array[2]),
+                              SkDoubleToScalar(array[3]));
     return true;
 }
 
@@ -1449,7 +1089,7 @@
                         const PdfDictionary& dict,
                         const char* key,
                         const char* abr,
-                        SkRect* data) {
+                        SkRect** data) {
     if (SkRectFromDictionary(pdfDoc, dict, key, data)) return true;
     if (abr == NULL || *abr == '\0') return false;
     return SkRectFromDictionary(pdfDoc, dict, abr, data);
@@ -1475,21 +1115,15 @@
     PdfOp_q(pdfContext, canvas, NULL);
     canvas->save();
 
-    if (get(skobj, "Resources")) {
-        SkPdfResourceDictionary* res = NULL;
 
-        PodofoMapper::map(*get(skobj, "Resources"), &res);
-
-        if (res) {
-            pdfContext->fGraphicsState.fResources = res;
-        }
+    if (skobj->Resources()) {
+        pdfContext->fGraphicsState.fResources = skobj->Resources();
     }
 
     SkTraceMatrix(pdfContext->fGraphicsState.fMatrix, "Current matrix");
 
-    SkMatrix matrix;
-    if (SkMatrixFromDictionary(pdfContext, skobj->podofo()->GetDictionary(), "Matrix", &matrix)) {
-        pdfContext->fGraphicsState.fMatrix.preConcat(matrix);
+    if (skobj->Matrix()) {
+        pdfContext->fGraphicsState.fMatrix.preConcat(*skobj->Matrix());
         pdfContext->fGraphicsState.fMatrixTm = pdfContext->fGraphicsState.fMatrix;
         pdfContext->fGraphicsState.fMatrixTlm = pdfContext->fGraphicsState.fMatrix;
         // TODO(edisonn) reset matrixTm and matricTlm also?
@@ -1499,9 +1133,8 @@
 
     canvas->setMatrix(pdfContext->fGraphicsState.fMatrix);
 
-    SkRect bbox;
-    if (SkRectFromDictionary(&pdfContext->fPdfDoc.podofo(), skobj->podofo()->GetDictionary(), "BBox", &bbox)) {
-        canvas->clipRect(bbox, SkRegion::kIntersect_Op, true);  // TODO(edisonn): AA from settings.
+    if (skobj->BBox()) {
+        canvas->clipRect(*skobj->BBox(), SkRegion::kIntersect_Op, true);  // TODO(edisonn): AA from settings.
     }
 
     // TODO(edisonn): iterate smart on the stream even if it is compressed, tokenize it as we go.
@@ -1523,6 +1156,47 @@
     return kNYI_PdfResult;
 }
 
+PdfResult doType3Char(PdfContext* pdfContext, SkCanvas* canvas, SkPdfObject* skobj, SkRect bBox, SkMatrix matrix, double textSize) {
+    if (!skobj || !skobj->podofo() || !skobj->podofo()->HasStream() || skobj->podofo()->GetStream() == NULL || skobj->podofo()->GetStream()->GetLength() == 0) {
+        return kOK_PdfResult;
+    }
+
+    PdfOp_q(pdfContext, canvas, NULL);
+    canvas->save();
+
+    pdfContext->fGraphicsState.fMatrixTm.preConcat(matrix);
+    pdfContext->fGraphicsState.fMatrixTm.preScale(SkDoubleToScalar(textSize), SkDoubleToScalar(textSize));
+
+    pdfContext->fGraphicsState.fMatrix = pdfContext->fGraphicsState.fMatrixTm;
+    pdfContext->fGraphicsState.fMatrixTlm = pdfContext->fGraphicsState.fMatrix;
+
+    SkTraceMatrix(pdfContext->fGraphicsState.fMatrix, "Total matrix");
+
+    canvas->setMatrix(pdfContext->fGraphicsState.fMatrix);
+
+    SkRect rm = bBox;
+    pdfContext->fGraphicsState.fMatrix.mapRect(&rm);
+
+    SkTraceRect(rm, "bbox mapped");
+
+    canvas->clipRect(bBox, SkRegion::kIntersect_Op, true);  // TODO(edisonn): AA from settings.
+
+    // TODO(edisonn): iterate smart on the stream even if it is compressed, tokenize it as we go.
+    // For this PdfContentsTokenizer needs to be extended.
+
+    PdfResult ret = kPartial_PdfResult;
+    SkPdfTokenizer tokenizer(skobj);
+    PdfMainLooper looper(NULL, &tokenizer, pdfContext, canvas);
+    looper.loop();
+
+    // TODO(edisonn): should we restore the variable stack at the same state?
+    // There could be operands left, that could be consumed by a parent tokenizer when we pop.
+    canvas->restore();
+    PdfOp_Q(pdfContext, canvas, NULL);
+    return ret;
+}
+
+
 // TODO(edisonn): faster, have the property on the SkPdfObject itself?
 std::set<const PdfObject*> gInRendering;
 
@@ -1651,15 +1325,15 @@
 
     // TODO(edisonn): Create factory methods or constructors so podofo is hidden
     PdfObject _ty(PdfVariant(-ty));
-    pdfContext->fObjectStack.push(new SkPdfNumber(&pdfContext->fPdfDoc.podofo(), &_ty));
+    pdfContext->fObjectStack.push(new SkPdfNumber(&pdfContext->fPdfDoc->podofo(), &_ty));
 
     PdfOp_TL(pdfContext, canvas, looper);
 
     PdfObject vtx(PdfVariant(-(-tx)));  // TODO(edisonn): Hmm, the compiler thinks I have here a function pointer if we use (tx), but not -(-tx)
-    pdfContext->fObjectStack.push(new SkPdfNumber(&pdfContext->fPdfDoc.podofo(), &vtx));
+    pdfContext->fObjectStack.push(new SkPdfNumber(&pdfContext->fPdfDoc->podofo(), &vtx));
 
     PdfObject vty(PdfVariant(-(-ty)));
-    pdfContext->fObjectStack.push(new SkPdfNumber(&pdfContext->fPdfDoc.podofo(), &vty));
+    pdfContext->fObjectStack.push(new SkPdfNumber(&pdfContext->fPdfDoc->podofo(), &vty));
 
     return PdfOp_Td(pdfContext, canvas, looper);
 }
@@ -1697,8 +1371,8 @@
     PdfObject zero(PdfVariant(0.0));
     PdfObject tl(PdfVariant(-(-pdfContext->fGraphicsState.fTextLeading)));
 
-    pdfContext->fObjectStack.push(new SkPdfNumber(&pdfContext->fPdfDoc.podofo(), &zero));
-    pdfContext->fObjectStack.push(new SkPdfNumber(&pdfContext->fPdfDoc.podofo(), &tl));
+    pdfContext->fObjectStack.push(new SkPdfNumber(&pdfContext->fPdfDoc->podofo(), &zero));
+    pdfContext->fObjectStack.push(new SkPdfNumber(&pdfContext->fPdfDoc->podofo(), &tl));
     return PdfOp_Td(pdfContext, canvas, looper);
 }
 
@@ -1823,7 +1497,6 @@
 
 PdfResult PdfOp_h(PdfContext* pdfContext, SkCanvas* canvas, PdfTokenLooper** looper) {
     pdfContext->fGraphicsState.fPath.close();
-    pdfContext->fGraphicsState.fPathClosed = true;
     return kOK_PdfResult;
 }
 
@@ -1972,11 +1645,11 @@
 
     SkPdfFontDictionary* fd = NULL;
     if (pdfContext->fGraphicsState.fResources->Font()) {
-        SkPdfObject objFont = pdfContext->fGraphicsState.fResources->Font()->get(fontName.c_str());
-        PodofoMapper::map(objFont, &fd);
+        SkPdfObject* objFont = pdfContext->fGraphicsState.fResources->Font()->get(fontName.c_str());
+        PodofoMapper::map(*objFont, &fd);
 
 #ifdef PDF_TRACE
-        objFont.podofo()->ToString(str);
+        objFont->podofo()->ToString(str);
         printf("Print Font loaded: %s\n", str.c_str());
         fd->podofo()->ToString(str);
         printf("Print Font loaded and resolved and upgraded: %s\n", str.c_str());
@@ -1990,24 +1663,6 @@
         pdfContext->fGraphicsState.fSkFont = skfont;
     }
 
-    // TODO(edisonn): Load font from pdfContext->fGraphicsState.fObjectWithResources ?
-    const PdfObject* pFont = resolveReferenceObject(&pdfContext->fPdfDoc.podofo(),
-                                                    pdfContext->fGraphicsState.fResources->Font()->get(fontName.c_str()).podofo());
-    if( !pFont )
-    {
-        // TODO(edisonn): try to ignore the error, make sure we do not crash.
-        return kIgnoreError_PdfResult;
-    }
-
-    PdfFont* font = pdfContext->fPdfDoc.podofo().GetFont( (PdfObject*)pFont );
-    if (font) {
-        pdfContext->fGraphicsState.fCurFont = font;
-    } else {
-        // TODO(edisonn): check ~/crasing, for one of the files PoDoFo throws exception
-        // when calling pFont->Reference(), with Linked list corruption.
-        return kIgnoreError_PdfResult;
-    }
-
     return kPartial_PdfResult;
 }
 
@@ -2350,7 +2005,7 @@
         return kIgnoreError_PdfResult;
     }
 
-    SkPdfObject value = extGStateDictionary->get(name.c_str());
+    SkPdfObject* value = extGStateDictionary->get(name.c_str());
 
 #ifdef PDF_TRACE
 //    value->ToString(str);
@@ -2358,7 +2013,7 @@
 #endif
 
     SkPdfGraphicsStateDictionary* gs = NULL;
-    PodofoMapper::map(value, &gs);
+    PodofoMapper::map(*value, &gs);
 
     // TODO(edisonn): now load all those properties in graphic state.
     if (gs == NULL) {
@@ -2420,7 +2075,6 @@
 
     return kNYI_PdfResult;
 }
-
 //rise Ts Set the text rise, Trise, to rise, which is a number expressed in unscaled text space
 //units. Initial value: 0.
 PdfResult PdfOp_Ts(PdfContext* pdfContext, SkCanvas* canvas, PdfTokenLooper** looper) {
@@ -2469,14 +2123,14 @@
         return kIgnoreError_PdfResult;
     }
 
-    SkPdfObject value = xObject->get(name.c_str());
+    SkPdfObject* value = xObject->get(name.c_str());
 
 #ifdef PDF_TRACE
 //    value->ToString(str);
 //    printf("Do object value: %s\n", str.c_str());
 #endif
 
-    return doXObject(pdfContext, canvas, value);
+    return doXObject(pdfContext, canvas, *value);
 }
 
 //tag MP Designate a marked-content point. tag is a name object indicating the role or
@@ -2779,7 +2433,7 @@
 
                 SkBitmap bitmap;
 #ifdef PDF_DEBUG_3X
-                setup_bitmap(&bitmap, 3 * (int)SkScalarToDouble(rect.width()), 3 * (int)SkScalarToDouble(rect.height()))
+                setup_bitmap(&bitmap, 3 * (int)SkScalarToDouble(rect.width()), 3 * (int)SkScalarToDouble(rect.height()));
 #else
                 setup_bitmap(&bitmap, (int)SkScalarToDouble(rect.width()), (int)SkScalarToDouble(rect.height()));
 #endif
@@ -2788,7 +2442,7 @@
 
                 SkPdfTokenizer* tokenizer = doc.tokenizerOfPage(pn);
 
-                PdfContext pdfContext(doc);
+                PdfContext pdfContext(&doc);
                 pdfContext.fOriginalMatrix = SkMatrix::I();
                 pdfContext.fGraphicsState.fResources = NULL;
                 PodofoMapper::map(*page->Resources(), &pdfContext.fGraphicsState.fResources);
diff --git a/experimental/PdfViewer/spec2def.py b/experimental/PdfViewer/spec2def.py
deleted file mode 100644
index f524d85..0000000
--- a/experimental/PdfViewer/spec2def.py
+++ /dev/null
@@ -1,611 +0,0 @@
-#!/usr/local/bin/python
-# coding: utf-8
-
-import sys
-import re
-
-# TODO(edisonn): put processed part of file in a new file
-# put unprocessed part, in a new file, so we see what we miss
-# keep blank lines, and generate a version without the blank lines
-
-#TODO (edisonn): deal manually with tables that don't have "KEY TYPE VALUE' header, e.g. 
-#         TABLE 7.11 Restrictions on the entries in a soft-mask image dictionary
-#KEY                       RESTRICTION
-
-
- 
-lines = 0
-table = ''
-tableHeaderFound = False
-tableLine = 0
-tableRow = 0
-columnWidth = []
-columnValues = None
-mustFollowTableHeader = False
-emitedDitionaryName = ''
-
-knownTypes = {
-'(any)',
-unicode('undefined', 'utf8'),
-'(undefined)',
-'(various)',
-'array',
-'or',
-'boolean',
-'date',
-'dictionary',
-'function',
-'integer',
-unicode('file', 'utf8'),
-'file',
-unicode('specification', 'utf8'),
-'specification',
-'name',
-'tree',
-'number',
-'rectangle',
-'stream',
-'string',
-'text',
-',',
-' '
-}
-
-# TODO(edisonn): add a third element in the vector, the base class, by default it is Dictionary
-# TODO(edisonn): add overrides for types map<field_name, type_name>
-# e.g. ,{'Resources', 'ResourceDictionary'}
-# TODO(edisonn): can be added one by one, or extracted from documentation
-
-tableToClassName = {
-'TABLE 3.4': ['StreamCommonDictionary', 'Entries common to all stream dictionaries'],
-'TABLE 3.7': ['LzwdecodeAndFlatedecodeFiltersDictionary', 'Optional parameters for LZWDecode and FlateDecode filters'],
-'TABLE 3.9': ['CcittfaxdecodeFilterDictionary', 'Optional parameters for the CCITTFaxDecode filter'],
-'TABLE 3.10': ['Jbig2DecodeFilterDictionary', 'Optional parameter for the JBIG2Decode filter'],
-'TABLE 3.11': ['DctdecodeFilterDictionary', 'Optional parameter for the DCTDecode filter'],
-'TABLE 3.12': ['FileTrailerDictionary', 'Entries in the file trailer dictionary'],
-'TABLE 3.13': ['EncryptionCommonDictionary', 'Entries common to all encryption dictionaries'],
-'TABLE 3.14': ['StandardSecurityHandlerDictionary', 'Additional encryption dictionary entries for the standard security handler'],
-'TABLE 3.16': ['CatalogDictionary', 'Entries in the catalog dictionary'],
-'TABLE 3.17': ['PageTreeNodeDictionary', 'Required entries in a page tree node'],
-'TABLE 3.18': ['PageObjectDictionary', 'Entries in a page object'],
-'TABLE 3.19': ['NameDictionary', 'Entries in the name dictionary'],
-'TABLE 3.21': ['ResourceDictionary', 'Entries in a resource dictionary'],
-'TABLE 3.23': ['NameTreeNodeDictionary', 'Entries in a name tree node dictionary'],
-'TABLE 3.25': ['NumberTreeNodeDictionary', 'Entries in a number tree node dictionary'],
-'TABLE 3.26': ['FunctionCommonDictionary', 'Entries common to all function dictionaries'],
-'TABLE 3.27': ['Type0FunctionDictionary', 'Additional entries specific to a type 0 function dictionary'],
-'TABLE 3.28': ['Type2FunctionDictionary', 'Additional entries specific to a type 2 function dictionary'],
-'TABLE 3.29': ['Type3FunctionDictionary', 'Additional entries specific to a type 3 function dictionary'],
-'TABLE 3.32': ['FileSpecificationDictionary', 'Entries in a file specification dictionary'],
-'TABLE 3.33': ['EmbeddedFileStreamDictionary', 'Additional entries in an embedded file stream dictionary'],
-'TABLE 3.34': ['EmbeddedFileParameterDictionary', 'Entries in an embedded file parameter dictionary'],
-'TABLE 3.35': ['MacOsFileInformationDictionary', 'Entries in a Mac OS file information dictionary'],
-'TABLE 4.8': ['GraphicsStateDictionary', 'Entries in a graphics state parameter dictionary'],
-'TABLE 4.13': ['CalgrayColorSpaceDictionary', 'Entries in a CalGray color space dictionary'],
-'TABLE 4.14': ['CalrgbColorSpaceDictionary', 'Entries in a CalRGB color space dictionary'],
-'TABLE 4.15': ['LabColorSpaceDictionary', 'Entries in a Lab color space dictionary'],
-'TABLE 4.16': ['IccProfileStreamDictionary', 'Additional entries specific to an ICC profile stream dictionary'],
-'TABLE 4.20': ['DeviceNColorSpaceDictionary', 'Entry in a DeviceN color space attributes dictionary'],
-'TABLE 4.22': ['Type1PatternDictionary', 'Additional entries specific to a type 1 pattern dictionary'],
-'TABLE 4.23': ['Type2PatternDictionary', 'Entries in a type 2 pattern dictionary'],
-'TABLE 4.25': ['ShadingDictionary', 'Entries common to all shading dictionaries'],
-'TABLE 4.26': ['Type1ShadingDictionary', 'Additional entries specific to a type 1 shading dictionary', 'ShadingDictionary'],
-'TABLE 4.27': ['Type2ShadingDictionary', 'Additional entries specific to a type 2 shading dictionary', 'ShadingDictionary'],
-'TABLE 4.28': ['Type3ShadingDictionary', 'Additional entries specific to a type 3 shading dictionary', 'ShadingDictionary'],
-'TABLE 4.29': ['Type4ShadingDictionary', 'Additional entries specific to a type 4 shading dictionary', 'ShadingDictionary'],
-'TABLE 4.30': ['Type5ShadingDictionary', 'Additional entries specific to a type 5 shading dictionary', 'ShadingDictionary'],
-'TABLE 4.31': ['Type6ShadingDictionary', 'Additional entries specific to a type 6 shading dictionary', 'ShadingDictionary'],
-'TABLE 4.35': ['ImageDictionary', 'Additional entries specific to an image dictionary', 'XObjectDictionary', {'Subtype': '[datatypes.PdfName(\'Image\')]'}],
-'TABLE 4.37': ['AlternateImageDictionary', 'Entries in an alternate image dictionary'],
-'TABLE 4.41': ['Type1FormDictionary', 'Additional entries specific to a type 1 form dictionary', 'XObjectDictionary', {'Subtype': '[datatypes.PdfName(\'Form\')]'}],
-'TABLE 4.42': ['GroupAttributesDictionary', 'Entries common to all group attributes dictionaries'],
-'TABLE 4.43': ['ReferenceDictionary', 'Entries in a reference dictionary'],
-'TABLE 4.44': ['PSXobjectDictionary', 'Additional entries specific to a PostScript XObject dictionary'],
-'TABLE 5.8': ['Type1FontDictionary', 'Entries in a Type 1 font dictionary', 'FontDictionary', {'Subtype': '[datatypes.PdfName(\'Type1\')]'}],
-'TABLE 5.9': ['Type3FontDictionary', 'Entries in a Type 3 font dictionary', 'Type0FontDictionary', {'Subtype': '[datatypes.PdfName(\'Type3\')]'}],
-'TABLE 5.11': ['EncodingDictionary', 'Entries in an encoding dictionary'],
-'TABLE 5.12': ['CIDSystemInfoDictionary', 'Entries in a CIDSystemInfo dictionary'],
-'TABLE 5.13': ['CIDFontDictionary', 'Entries in a CIDFont dictionary', 'FontDictionary', {'Subtype': '[datatypes.PdfName(\'CIDFontType0\'), datatypes.PdfName(\'CIDFontType2\')]'}],
-'TABLE 5.16': ['CMapDictionary', 'Additional entries in a CMap dictionary'],
-'TABLE 5.17': ['Type0FontDictionary', 'Entries in a Type 0 font dictionary', 'FontDictionary', {'Subtype': '[datatypes.PdfName(\'Type0\')]'}],
-'TABLE 5.18': ['FontDescriptorDictionary', 'Entries common to all font descriptors'],
-'TABLE 5.20': ['CIDFontDescriptorDictionary', 'Additional font descriptor entries for CIDFonts'],
-'TABLE 5.23': ['EmbeddedFontStreamDictionary', 'Additional entries in an embedded font stream dictionary'],
-'TABLE 6.3': ['Type1HalftoneDictionary', 'Entries in a type 1 halftone dictionary'],
-'TABLE 6.4': ['Type6HalftoneDictionary', 'Additional entries specific to a type 6 halftone dictionary'],
-'TABLE 6.5': ['Type10HalftoneDictionary', 'Additional entries specific to a type 10 halftone dictionary'],
-'TABLE 6.6': ['Type16HalftoneDictionary', 'Additional entries specific to a type 16 halftone dictionary'],
-'TABLE 6.7': ['Type5HalftoneDictionary', 'Entries in a type 5 halftone dictionary'],
-'TABLE 7.10': ['SoftMaskDictionary', 'Entries in a soft-mask dictionary'],
-'TABLE 7.12': ['SoftMaskImageDictionary', 'Additional entry in a soft-mask image dictionary'],
-'TABLE 7.13': ['TransparencyGroupDictionary', 'Additional entries specific to a transparency group attributes dictionary'],
-'TABLE 8.1': ['ViewerPreferencesDictionary', 'Entries in a viewer preferences dictionary'],
-'TABLE 8.3': ['OutlineDictionary', 'Entries in the outline dictionary'],
-'TABLE 8.4': ['OutlineItemDictionary', 'Entries in an outline item dictionary'],
-'TABLE 8.6': ['PageLabelDictionary', 'Entries in a page label dictionary'],
-'TABLE 8.7': ['ThreadDictionary', 'Entries in a thread dictionary'],
-'TABLE 8.8': ['BeadDictionary', 'Entries in a bead dictionary'],
-'TABLE 8.9': ['TransitionDictionary', 'Entries in a transition dictionary'],
-'TABLE 8.10': ['AnnotationDictionary', 'Entries common to all annotation dictionaries'],
-'TABLE 8.12': ['BorderStyleDictionary', 'Entries in a border style dictionary'],
-'TABLE 8.13': ['AppearanceDictionary', 'Entries in an appearance dictionary'],
-'TABLE 8.15': ['TextAnnotationDictionary', 'Additional entries specific to a text annotation'],
-'TABLE 8.16': ['ALinkAnnotationDictionary', 'Additional entries specific to a link annotation'],
-'TABLE 8.17': ['FreeTextAnnotationDictionary', 'Additional entries specific to a free text annotation'],
-'TABLE 8.18': ['LineAnnotationDictionary', 'Additional entries specific to a line annotation'],
-'TABLE 8.20': ['SquareOrCircleAnnotation', 'Additional entries specific to a square or circle annotation'],
-'TABLE 8.21': ['MarkupAnnotationsDictionary', 'Additional entries specific to markup annotations'],
-'TABLE 8.22': ['RubberStampAnnotationDictionary', 'Additional entries specific to a rubber stamp annotation'],
-'TABLE 8.23': ['InkAnnotationDictionary', 'Additional entries specific to an ink annotation'],
-'TABLE 8.24': ['PopUpAnnotationDictionary', 'Additional entries specific to a pop-up annotation'],
-'TABLE 8.25': ['FileAttachmentAnnotationDictionary', 'Additional entries specific to a file attachment annotation'],
-'TABLE 8.26': ['SoundAnnotationDictionary', 'Additional entries specific to a sound annotation'],
-'TABLE 8.27': ['MovieAnnotationDictionary', 'Additional entries specific to a movie annotation'],
-'TABLE 8.28': ['WidgetAnnotationDictionary', 'Additional entries specific to a widget annotation'],
-'TABLE 8.29': ['ActionDictionary', 'Entries common to all action dictionaries'],
-'TABLE 8.30': ['AnnotationActionsDictionary', 'Entries in an annotation\'s additional-actions dictionary'],
-'TABLE 8.31': ['PageObjectActionsDictionary', 'Entries in a page object\'s additional-actions dictionary'],
-'TABLE 8.32': ['FormFieldActionsDictionary', 'Entries in a form field\'s additional-actions dictionary'],
-'TABLE 8.33': ['DocumentCatalogActionsDictionary', 'Entries in the document catalog\'s additional-actions dictionary'],
-'TABLE 8.35': ['GoToActionDictionary', 'Additional entries specific to a go-to action'],
-'TABLE 8.36': ['RemoteGoToActionDictionary', 'Additional entries specific to a remote go-to action'],
-'TABLE 8.37': ['LaunchActionDictionary', 'Additional entries specific to a launch action'],
-'TABLE 8.38': ['WindowsLaunchActionDictionary', 'Entries in a Windows launch parameter dictionary'],
-'TABLE 8.39': ['ThreadActionDictionary', 'Additional entries specific to a thread action'],
-'TABLE 8.40': ['URIActionDictionary', 'Additional entries specific to a URI action'],
-'TABLE 8.41': ['URIDictionary', 'Entry in a URI dictionary'],
-'TABLE 8.42': ['SoundActionDictionary', 'Additional entries specific to a sound action'],
-'TABLE 8.43': ['MovieActionDictionary', 'Additional entries specific to a movie action'],
-'TABLE 8.44': ['HideActionDictionary', 'Additional entries specific to a hide action'],
-'TABLE 8.46': ['NamedActionsDictionary', 'Additional entries specific to named actions'],
-'TABLE 8.47': ['InteractiveFormDictionary', 'Entries in the interactive form dictionary'],
-'TABLE 8.49': ['FieldDictionary', 'Entries common to all field dictionaries'],
-'TABLE 8.51': ['VariableTextFieldDictionary', 'Additional entries common to all fields containing variable text'],
-'TABLE 8.52': ['AppearanceCharacteristicsDictionary', 'Entries in an appearance characteristics dictionary'],
-'TABLE 8.54': ['CheckboxFieldDictionary', 'Additional entry specific to a checkbox field'],
-'TABLE 8.55': ['RadioButtonFieldDictionary', 'Additional entry specific to a radio button field'],
-'TABLE 8.57': ['TextFieldDictionary', 'Additional entry specific to a text field'],
-'TABLE 8.59': ['ChoiceFieldDictionary', 'Additional entries specific to a choice field'],
-'TABLE 8.60': ['SignatureDictionary', 'Entries in a signature dictionary'],
-'TABLE 8.61': ['SubmitFormActionDictionary', 'Additional entries specific to a submit-form action'],
-'TABLE 8.63': ['ResetFormActionDictionary', 'Additional entries specific to a reset-form action'],
-'TABLE 8.65': ['ImportDataActionDictionary', 'Additional entries specific to an import-data action'],
-'TABLE 8.66': ['JavascriptActionDictionary', 'Additional entries specific to a JavaScript action'],
-'TABLE 8.67': ['FDFTrailerDictionary', 'Entry in the FDF trailer dictionary'],
-'TABLE 8.68': ['FDFCatalogDictionary', 'Entries in the FDF catalog dictionary'],
-'TABLE 8.69': ['FDFDictionary', 'Entries in the FDF dictionary'],
-'TABLE 8.70': ['EncryptedEmbeddedFileStreamDictionary', 'Additional entry in an embedded file stream dictionary for an encrypted FDF file'],
-'TABLE 8.71': ['JavascriptDictionary', 'Entries in the JavaScript dictionary'],
-'TABLE 8.72': ['FDFFieldDictionary', 'Entries in an FDF field dictionary'],
-'TABLE 8.73': ['IconFitDictionary', 'Entries in an icon fit dictionary'],
-'TABLE 8.74': ['FDFPageDictionary', 'Entries in an FDF page dictionary'],
-'TABLE 8.75': ['FDFTemplateDictionary', 'Entries in an FDF template dictionary'],
-'TABLE 8.76': ['FDFNamedPageReferenceDictionary', 'Entries in an FDF named page reference dictionary'],
-'TABLE 8.77': ['FDFFileAnnotationDictionary', 'Additional entry for annotation dictionaries in an FDF file'],
-'TABLE 8.78': ['SoundObjectDictionary', 'Additional entries specific to a sound object'],
-'TABLE 8.79': ['MovieDictionary', 'Entries in a movie dictionary'],
-'TABLE 8.80': ['MovieActivationDictionary', 'Entries in a movie activation dictionary'],
-'TABLE 9.2': ['DocumentInformationDictionary', 'Entries in the document information dictionary'],
-'TABLE 9.3': ['MetadataStreamDictionary', 'Additional entries in a metadata stream dictionary'],
-'TABLE 9.4': ['ComponentsWithMetadataDictionary', 'Additional entry for components having metadata'],
-'TABLE 9.6': ['PagePieceDictionary', 'Entries in a page-piece dictionary'],
-'TABLE 9.7': ['ApplicationDataDictionary', 'Entries in an application data dictionary'],
-'TABLE 9.9': ['StructureTreeRootDictionary', 'Entries in the structure tree root'],
-'TABLE 9.10': ['StructureElementDictionary', 'Entries in a structure element dictionary'],
-'TABLE 9.11': ['MarkedContentReferenceDictionary', 'Entries in a marked-content reference dictionary'],
-'TABLE 9.12': ['ObjectReferenceDictionary', 'Entries in an object reference dictionary'],
-'TABLE 9.13': ['StructureElementAccessDictionary', 'Additional dictionary entries for structure element access'],
-'TABLE 9.14': ['AttributeObjectDictionary', 'Entry common to all attribute objects'],
-'TABLE 9.15': ['MarkInformationDictionary', 'Entry in the mark information dictionary'],
-'TABLE 9.16': ['ArtifactsDictionary', 'Property list entries for artifacts'],
-'TABLE 9.27': ['StandardStructureDictionary', 'Standard layout attributes common to all standard structure types'],
-'TABLE 9.28': ['BlockLevelStructureElementsDictionary', 'Additional standard layout attributes specific to block-level structure elements'],
-'TABLE 9.29': ['InlineLevelStructureElementsDictionary', 'Standard layout attributes specific to inline-level structure elements'],
-'TABLE 9.30': ['ListAttributeDictionary', 'Standard list attribute'],
-'TABLE 9.31': ['TableAttributesDictionary', 'Standard table attributes'],
-'TABLE 9.32': ['WebCaptureInformationDictionary', 'Entries in the Web Capture information dictionary'],
-'TABLE 9.33': ['WebCaptureDictionary', 'Entries common to all Web Capture content sets'],
-'TABLE 9.34': ['WebCapturePageSetDictionary', 'Additional entries specific to a Web Capture page set'],
-'TABLE 9.35': ['WebCaptureImageSetDictionary', 'Additional entries specific to a Web Capture image set'],
-'TABLE 9.36': ['SourceInformationDictionary', 'Entries in a source information dictionary'],
-'TABLE 9.37': ['URLAliasDictionary', 'Entries in a URL alias dictionary'],
-'TABLE 9.38': ['WebCaptureCommandDictionary', 'Entries in a Web Capture command dictionary'],
-'TABLE 9.40': ['WebCaptureCommandSettingsDictionary', 'Entries in a Web Capture command settings dictionary'],
-'TABLE 9.41': ['BoxColorInformationDictionary', 'Entries in a box color information dictionary'],
-'TABLE 9.42': ['BoxStyleDictionary', 'Entries in a box style dictionary'],
-'TABLE 9.43': ['PrinterMarkAnnotationDictionary', 'Additional entries specific to a printer\'s mark annotation'],
-'TABLE 9.44': ['PrinterMarkFormDictionary', 'Additional entries specific to a printer\'s mark form dictionary'],
-'TABLE 9.45': ['SeparationDictionary', 'Entries in a separation dictionary'],
-'TABLE 9.46': ['PDF_XOutputIntentDictionary', 'Entries in a PDF/X output intent dictionary'],
-'TABLE 9.47': ['TrapNetworkAnnotationDictionary', 'Additional entries specific to a trap network annotation'],
-'TABLE 9.48': ['TrapNetworkAppearanceStreamDictionary', 'Additional entries specific to a trap network appearance stream'],
-'TABLE 9.49': ['OpiVersionDictionary', 'Entry in an OPI version dictionary'],
-}
-
-
-def acceptType(val):
-  global knownTypes
-  
-  ret = val
-  
-  for item in knownTypes:
-    ret = ret.replace(item, '')
-    
-  return ret == ''
-
-
-def inTable():
-  global tableHeaderFound
-  return tableHeaderFound    
-
-def tableDescriptionFound(desc): 
-  global table
-  table = desc.strip()    
-
-def tableHasHeader(): 
-  global table
-  global tableHeaderFound
-
-  tableHeaderFound = True
-  #print table    
-
-def fix(val):
-  ret = val
-  
-  # fix unicode chars
-  ret = ret.replace(unicode('fi', 'utf8'), 'fi')
-  ret = ret.replace(u'\u201c', '\"')
-  ret = ret.replace(u'\u201d', '\"')
-  ret = ret.replace(u'\u2019', '\'')
-  ret = ret.replace(u'\ufb02', 'fl')
-  ret = ret.replace(u'\xae', '(R)')
-  ret = ret.replace(u'\u2026', '...')
-  ret = ret.replace(u'\xd7', 'x')
-  ret = ret.replace(u'\u2212', '-')
-  ret = ret.replace(u'\u2264', '<=')
-  ret = ret.replace(u'\u2014', '-')
-  ret = ret.replace(u'\u2013', '\'')
-  ret = ret.replace(u'\u2022', '*')
-  ret = ret.replace(u'\xb5', 'mu')
-  ret = ret.replace(u'\xf7', '/')
-  
-
-  # how enable to emit this a python string
-  ret = ret.replace('\'', '\\\'')
-  ret = ret.replace('\n', '\\n')
-
-  
-  return ret
-  
-def commitRow():
-  global columnValues
-  global emitedDitionaryName
-  global table
-  global tableToClassName
-  
-  if columnValues == None:
-    return
-  
-  #print columnValues
-  
-  lastClosed = columnValues[2].find(')')
-  if lastClosed < 0:
-    print 'ERRRRRRRRRRRRRRROR'
-    print columnValues
-    return
-    
-  spec = columnValues[2][:lastClosed + 1]
-  spec = spec.replace('(', ';')
-  spec = spec.replace(')', ';')
-  spec = spec.strip(';')
-  
-  specs = spec.split(';')
-
-  # clearly required, but it can be required with conditions. don't handle this ones here, but manually  
-  required = specs[0] == 'Required' 
-  
-  inheritable = False
-  version = ''
-  for s in specs:
-    if s.strip() == 'inheritable' or s.strip() == 'Inheritable':
-      inheritable = True
-    elif re.match('^PDF [0-9]*[\.[0-9]*]*', s.strip()):
-      version = s.strip()
-    elif s != 'Required':
-      required = False
-      
-  #print spec
-  #print specs
-  #print required
-  #print inheritable
-  #print version
-  #print columnValues
-  
-  columnValues = [fix(columnValues[0]), fix(columnValues[1]), fix(columnValues[2])]
-  
-  tableKey = re.search('(TABLE [0-9].[0-9][0-9]?)', table).group(1)
-
-  if emitedDitionaryName == '':
-    table = fix(table)
-    
-    #print table
-    emitedDitionaryName = 'foo'
-    e = re.search('[Entries|Entry] in [a-z]* (.* dictionary)', table)
-    a = re.search('Additional [a-z]* in a[n]? (.* dictionary)', table)
-    s = re.search('Additional [a-z]* (.*)', table)
-    c = re.search('[Entries|Entry] common to all (.*)', table)
-    o1 = re.search('Optional parameter[s]? for the (.*)', table)
-    o2 = re.search('Optional parameter[s]? for (.*)', table)
-    t = re.search('.*ntries in [a-z]* (.*)', table)
-
-    r = re.search('Property list entries for (.*)', table)
-    st = re.search('Standard (.*)', table)
-    
-    if e:
-      emitedDitionaryName = e.group(1).title().replace(' ', '')
-      #print emitedDitionaryName
-    elif a:
-      emitedDitionaryName = a.group(1).title().replace(' ', '')
-      #print emitedDitionaryName
-    elif s:
-      emitedDitionaryName = s.group(1).title().replace(' ', '')
-      #print emitedDitionaryName
-    elif c:
-      emitedDitionaryName = c.group(1).title().replace(' ', '') + 'Common'
-      #print emitedDitionaryName
-    elif o1:
-      emitedDitionaryName = o1.group(1).title().replace(' ', '') + 'OptionalParameters'
-      #print emitedDitionaryName
-    elif o2:
-      emitedDitionaryName = o2.group(1).title().replace(' ', '') + 'OptionalParameters'
-      #print emitedDitionaryName
-    elif t:
-      emitedDitionaryName = t.group(1).title().replace(' ', '') + 'Dictionary'
-      #print emitedDitionaryName
-    elif r:
-      emitedDitionaryName = r.group(1).title().replace(' ', '') + 'Dictionary'
-      #print emitedDitionaryName
-    elif st:
-      emitedDitionaryName = st.group(1).title().replace(' ', '')  + 'Dictionary'
-      #print emitedDitionaryName
-    #else:
-      #print table
-    
-    #print tableKey
-    #print('\'' + tableKey + '\': [\'' + emitedDitionaryName + '\', \'' + table[len(tableKey) + 1:] + '\'],')
-
-    emitedDitionaryName = tableToClassName[tableKey][0]
-    comment = fix(tableToClassName[tableKey][1])
-    
-    if len(tableToClassName[tableKey]) >= 3 and tableToClassName[tableKey][2] != '':
-      print('  pdfspec.addClass(\'' + emitedDitionaryName + '\', \'' + tableToClassName[tableKey][2] + '\', \'' + comment + '\')\\')
-    else:
-      print('  pdfspec.addClass(\'' + emitedDitionaryName + '\', \'Dictionary\', \'' + comment + '\')\\')
-
-  if len(tableToClassName[tableKey]) >= 4 and columnValues[0] in tableToClassName[tableKey][3]:
-    required = True
-
-  if required:
-    print('      .required(\'NULL\')\\')
-  else:
-    print('      .optional()\\')
-    
-  print('          .field(\'' + columnValues[0] + '\')\\')
-  print('          .name(\'' + columnValues[0] + '\')\\')
-  print('          .type(\'' + columnValues[1] + '\')\\')
-  print('          .comment(\'' + columnValues[2] + '\')\\')
-
-  if len(tableToClassName[tableKey]) >= 4 and columnValues[0] in tableToClassName[tableKey][3]:
-    print('          .must(' + tableToClassName[tableKey][3][columnValues[0]] + ')\\')
-
-  print('          .done().done()\\')
-  
-  
-  columnValues = None
-  
-def newRow(first, second, third):
-  global columnValues 
-  columnValues = [first.rstrip(), second.rstrip(), third.rstrip()]
-
-def appendRow(second, third):
-  global columnValues
-  if second.rstrip() != '':
-    columnValues[1] = columnValues[1] + ' ' + second.rstrip()
-  if third.rstrip() != '':
-    columnValues[2] = columnValues[2] + '\n' + third.rstrip()
-
-def rebaseTable(line):
-  global knownTypes
-  global columnWidth
-  
-  line2 = line.replace(',', ' , ')
-  
-  words = line2.split()
-  
-  if len(words) < 3:
-    return False
-
-  i = 1
-  while i < len(words) - 1 and words[i] in knownTypes:
-    i = i + 1
-    
-  if words[i].startswith('(Optional') or words[i].startswith('(Required'):
-    commitRow()
-    
-    columnWidth[0] = line.find(words[1])
-    
-    if words[i].startswith('(Optional'):
-      columnWidth[1] = line.find('(Optional') - columnWidth[0] 
-    if words[i].startswith('(Required'):
-      columnWidth[1] = line.find('(Required') - columnWidth[0] 
-    return True
-    
-  return False
-    
-    
-def stopTable():
-  global tableHeaderFound
-  global emitedDitionaryName
-
-  if not inTable():
-    return
-  
-  commitRow()
-  tableHeaderFound = False
-  emitedDitionaryName = ''
-  print('      .done()')
-  print
-    
-
-def killTable():
-  return
-
-def processLineCore(line):
-  global lines
-  global tableLine
-  global tableRow
-  global columnWidth
-  global columnValues
-  global mustFollowTableHeader
-  
-  global fnewspec
-  
-  lines = lines + 1
-  
-  line = unicode(line, 'utf8')
-  
-  striped = line.rstrip()
-  
-  words = line.split()
-  if len(words) == 0:
-    stopTable()
-    return False
-        
-  isTableHeader = re.search('^[\s]*(TABLE [0-9].[0-9][0-9]?)', striped)
-  if isTableHeader:
-    stopTable()
-    tableDescriptionFound(striped)
-    mustFollowTableHeader = True
-    return False
-  
-  if mustFollowTableHeader:
-    mustFollowTableHeader = False
-    if len(words) != 3:
-      killTable()
-      return False
- 
-    # TODO(edisonn): support for generic table!
-    if words[0] != 'KEY' or words[1] != 'TYPE' or words[2] != 'VALUE':
-      killTable()
-      return False
-
-    tableHasHeader()
-    columnWidth = [0, 0, 0]
-    columnWidth[0] = striped.index('TYPE')
-    columnWidth[1] = striped.index('VALUE') - striped.index('TYPE')
-    columnWidth[2] = 0
-    return True
-      
-  if inTable():
-    tableLine = tableLine + 1
-    first = striped[0 : columnWidth[0]]
-    second = striped[columnWidth[0] : columnWidth[0] + columnWidth[1]]
-    third = striped[columnWidth[0] + columnWidth[1] :]
-
-    if tableLine == 1:
-      if third[0] != '(':
-        killTable()
-        return False
-
-      newRow(first, second, third)
-      return True
-    
-    if rebaseTable(striped):
-      first = striped[0 : columnWidth[0]]
-      second = striped[columnWidth[0] : columnWidth[0] + columnWidth[1]]
-      third = striped[columnWidth[0] + columnWidth[1] :]
-    
-    first = first.rstrip()
-    second = second.rstrip()
-    third = third.rstrip()
-        
-    if first == '' and second == '' and third != '':
-      appendRow(second, third)
-      return True
-      
-    if len(first.split()) > 1:
-      stopTable()
-      return False
-
-    if first != '' and first[0] == ' ':
-      stopTable()
-      return False
-
-    if first != '' and second != '' and third == '':
-      stopTable()
-      return False
-
-    if first == '' and second != '' and second[0] != ' ':
-      if acceptType(second):
-        appendRow(second, third)
-        return True
-      else:
-        stopTable()
-        return False
-
-    if first != '' and second != '' and third[0] != '(':
-      stopTable()
-      return False
-      
-    if first == '' and second != '' and second[0] == ' ':
-      stopTable()
-      return False
-
-    if first != '' and second != '' and third[0] == '(':
-      commitRow()
-      newRow(first, second, third)
-      return True
-    
-    return False
-  return False
-  
-def processLine(line):
-  global fnewspec
-  
-  inSpec = processLineCore(line)
-  
-  #just return, use the next lines if you wish to rewrite spec
-  #return
-  
-  if inSpec:
-    #resize colum with types
-    line = line[:columnWidth[0] + columnWidth[1]] + (' ' * (60 - columnWidth[1])) + line[columnWidth[0] + columnWidth[1]:]
-    line = line[:columnWidth[0]] + (' ' * (40 - columnWidth[0])) + line[columnWidth[0]:]
-  
-  fnewspec.write(line)
-  
-
-def generateDef():
-  global lines
-  global fnewspec
-  
-  fnewspec = open('PdfReference-okular-2.txt', 'w')
-  
-  print 'import datatypes'
-  print
-
-  print 'def buildPdfSpec(pdfspec):'
-  
-  for line in sys.stdin:
-    processLine(line)
-   
-  # close last table if it was not closed already 
-  stopTable()
-  
-  print
-  
-  #print lines
-  fnewspec.close()
-
-if '__main__' == __name__:
-  sys.exit(generateDef())
\ No newline at end of file