blob: ba556ff3906723631be4aa39f9aefc7fd0fe2fbd [file] [log] [blame]
edisonn@google.com222382b2013-07-10 22:33:10 +00001/*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8
9#ifndef SkPdfParser_DEFINED
10#define SkPdfParser_DEFINED
11
12#include "SkPdfBasics.h"
13#include "SkPdfNativeTokenizer.h"
14
15extern "C" PdfContext* gPdfContext;
16extern "C" SkBitmap* gDumpBitmap;
17extern "C" SkCanvas* gDumpCanvas;
18
19class SkCanvas;
20class SkNativeParsedPDF;
21
22// TODO(edisonn): move in another file
23class SkPdfRenderer : public SkRefCnt {
24 SkNativeParsedPDF* fPdfDoc;
25public:
26 SkPdfRenderer() : fPdfDoc(NULL) {}
27 virtual ~SkPdfRenderer() {unload();}
28
29 // TODO(edisonn): add options to render forms, or not
30 bool renderPage(int page, SkCanvas* canvas) const;
31
32 bool load(const SkString inputFileName);
33 bool loaded() const {return fPdfDoc != NULL;}
34 int pages() const;
35 void unload();
36 SkRect MediaBox(int page) const;
37};
38
39void reportPdfRenderStats();
40
41#endif // SkPdfParser_DEFINED