OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PDF_PDF_H_ | 5 #ifndef PDF_PDF_H_ |
6 #define PDF_PDF_H_ | 6 #define PDF_PDF_H_ |
7 | 7 |
8 #include "ppapi/c/ppb.h" | 8 #include "ppapi/c/ppb.h" |
9 #include "ppapi/cpp/module.h" | 9 #include "ppapi/cpp/module.h" |
10 | 10 |
| 11 #if defined(OS_WIN) |
| 12 #include <windows.h> |
| 13 #endif |
| 14 |
| 15 #if defined(OS_WIN) |
| 16 typedef void (*PDFEnsureTypefaceCharactersAccessible)(const LOGFONT& font, |
| 17 const wchar_t* text, |
| 18 size_t text_length); |
| 19 #endif |
| 20 |
11 namespace chrome_pdf { | 21 namespace chrome_pdf { |
12 | 22 |
13 class PDFModule : public pp::Module { | 23 class PDFModule : public pp::Module { |
14 public: | 24 public: |
15 PDFModule(); | 25 PDFModule(); |
16 ~PDFModule() override; | 26 ~PDFModule() override; |
17 | 27 |
18 // pp::Module implementation. | 28 // pp::Module implementation. |
19 bool Init() override; | 29 bool Init() override; |
20 pp::Instance* CreateInstance(PP_Instance instance) override; | 30 pp::Instance* CreateInstance(PP_Instance instance) override; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 int dpi, | 70 int dpi, |
61 int bounds_origin_x, | 71 int bounds_origin_x, |
62 int bounds_origin_y, | 72 int bounds_origin_y, |
63 int bounds_width, | 73 int bounds_width, |
64 int bounds_height, | 74 int bounds_height, |
65 bool fit_to_bounds, | 75 bool fit_to_bounds, |
66 bool stretch_to_bounds, | 76 bool stretch_to_bounds, |
67 bool keep_aspect_ratio, | 77 bool keep_aspect_ratio, |
68 bool center_in_bounds, | 78 bool center_in_bounds, |
69 bool autorotate); | 79 bool autorotate); |
70 #endif | 80 |
| 81 void SetPDFEnsureTypefaceCharactersAccessible( |
| 82 PDFEnsureTypefaceCharactersAccessible func); |
| 83 |
| 84 void SetPDFUseGDIPrinting(bool enable); |
| 85 #endif // defined(OS_WIN) |
| 86 |
71 // |page_count| and |max_page_width| are optional and can be NULL. | 87 // |page_count| and |max_page_width| are optional and can be NULL. |
72 // Returns false if the document is not valid. | 88 // Returns false if the document is not valid. |
73 bool GetPDFDocInfo(const void* pdf_buffer, | 89 bool GetPDFDocInfo(const void* pdf_buffer, |
74 int buffer_size, int* page_count, | 90 int buffer_size, int* page_count, |
75 double* max_page_width); | 91 double* max_page_width); |
76 | 92 |
77 // Gets the dimensions of a specific page in a document. | 93 // Gets the dimensions of a specific page in a document. |
78 // |pdf_buffer| is the buffer that contains the entire PDF document to be | 94 // |pdf_buffer| is the buffer that contains the entire PDF document to be |
79 // rendered. | 95 // rendered. |
80 // |pdf_buffer_size| is the size of |pdf_buffer| in bytes. | 96 // |pdf_buffer_size| is the size of |pdf_buffer| in bytes. |
(...skipping 23 matching lines...) Expand all Loading... |
104 int page_number, | 120 int page_number, |
105 void* bitmap_buffer, | 121 void* bitmap_buffer, |
106 int bitmap_width, | 122 int bitmap_width, |
107 int bitmap_height, | 123 int bitmap_height, |
108 int dpi, | 124 int dpi, |
109 bool autorotate); | 125 bool autorotate); |
110 | 126 |
111 } // namespace chrome_pdf | 127 } // namespace chrome_pdf |
112 | 128 |
113 #endif // PDF_PDF_H_ | 129 #endif // PDF_PDF_H_ |
OLD | NEW |