| 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 #include "pdf/pdf.h" | 5 #include "pdf/pdf.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 fit_to_bounds, stretch_to_bounds, keep_aspect_ratio, center_in_bounds, | 108 fit_to_bounds, stretch_to_bounds, keep_aspect_ratio, center_in_bounds, |
| 109 autorotate); | 109 autorotate); |
| 110 bool ret = engine_exports->RenderPDFPageToDC(pdf_buffer, buffer_size, | 110 bool ret = engine_exports->RenderPDFPageToDC(pdf_buffer, buffer_size, |
| 111 page_number, settings, dc); | 111 page_number, settings, dc); |
| 112 if (!g_sdk_initialized_via_pepper) | 112 if (!g_sdk_initialized_via_pepper) |
| 113 ShutdownSDK(); | 113 ShutdownSDK(); |
| 114 | 114 |
| 115 return ret; | 115 return ret; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void SetPDFEnsureTypefaceCharactersAccessible( |
| 119 PDFEnsureTypefaceCharactersAccessible func) { |
| 120 PDFEngineExports::Get()->SetPDFEnsureTypefaceCharactersAccessible(func); |
| 121 } |
| 122 |
| 123 void SetPDFUseGDIPrinting(bool enable) { |
| 124 PDFEngineExports::Get()->SetPDFUseGDIPrinting(enable); |
| 125 } |
| 118 #endif // defined(OS_WIN) | 126 #endif // defined(OS_WIN) |
| 119 | 127 |
| 120 bool GetPDFDocInfo(const void* pdf_buffer, | 128 bool GetPDFDocInfo(const void* pdf_buffer, |
| 121 int buffer_size, int* page_count, | 129 int buffer_size, int* page_count, |
| 122 double* max_page_width) { | 130 double* max_page_width) { |
| 123 if (!g_sdk_initialized_via_pepper) { | 131 if (!g_sdk_initialized_via_pepper) { |
| 124 if (!InitializeSDK()) | 132 if (!InitializeSDK()) |
| 125 return false; | 133 return false; |
| 126 } | 134 } |
| 127 PDFEngineExports* engine_exports = PDFEngineExports::Get(); | 135 PDFEngineExports* engine_exports = PDFEngineExports::Get(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 autorotate); | 175 autorotate); |
| 168 bool ret = engine_exports->RenderPDFPageToBitmap( | 176 bool ret = engine_exports->RenderPDFPageToBitmap( |
| 169 pdf_buffer, pdf_buffer_size, page_number, settings, bitmap_buffer); | 177 pdf_buffer, pdf_buffer_size, page_number, settings, bitmap_buffer); |
| 170 if (!g_sdk_initialized_via_pepper) | 178 if (!g_sdk_initialized_via_pepper) |
| 171 ShutdownSDK(); | 179 ShutdownSDK(); |
| 172 | 180 |
| 173 return ret; | 181 return ret; |
| 174 } | 182 } |
| 175 | 183 |
| 176 } // namespace chrome_pdf | 184 } // namespace chrome_pdf |
| OLD | NEW |