Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: pdf/pdf.cc

Issue 2633573002: Add Postscript Printing (Closed)
Patch Set: Fix Linux compile error Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 117
118 void SetPDFEnsureTypefaceCharactersAccessible( 118 void SetPDFEnsureTypefaceCharactersAccessible(
119 PDFEnsureTypefaceCharactersAccessible func) { 119 PDFEnsureTypefaceCharactersAccessible func) {
120 PDFEngineExports::Get()->SetPDFEnsureTypefaceCharactersAccessible(func); 120 PDFEngineExports::Get()->SetPDFEnsureTypefaceCharactersAccessible(func);
121 } 121 }
122 122
123 void SetPDFUseGDIPrinting(bool enable) { 123 void SetPDFUseGDIPrinting(bool enable) {
124 PDFEngineExports::Get()->SetPDFUseGDIPrinting(enable); 124 PDFEngineExports::Get()->SetPDFUseGDIPrinting(enable);
125 } 125 }
126
127 void SetPDFPostscriptPrintingLevel(int postscript_level) {
128 PDFEngineExports::Get()->SetPDFPostscriptPrintingLevel(postscript_level);
129 }
126 #endif // defined(OS_WIN) 130 #endif // defined(OS_WIN)
127 131
128 bool GetPDFDocInfo(const void* pdf_buffer, 132 bool GetPDFDocInfo(const void* pdf_buffer,
129 int buffer_size, 133 int buffer_size,
130 int* page_count, 134 int* page_count,
131 double* max_page_width) { 135 double* max_page_width) {
132 if (!g_sdk_initialized_via_pepper) { 136 if (!g_sdk_initialized_via_pepper) {
133 if (!InitializeSDK()) 137 if (!InitializeSDK())
134 return false; 138 return false;
135 } 139 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 int bitmap_width, 171 int bitmap_width,
168 int bitmap_height, 172 int bitmap_height,
169 int dpi, 173 int dpi,
170 bool autorotate) { 174 bool autorotate) {
171 if (!g_sdk_initialized_via_pepper) { 175 if (!g_sdk_initialized_via_pepper) {
172 if (!InitializeSDK()) 176 if (!InitializeSDK())
173 return false; 177 return false;
174 } 178 }
175 PDFEngineExports* engine_exports = PDFEngineExports::Get(); 179 PDFEngineExports* engine_exports = PDFEngineExports::Get();
176 PDFEngineExports::RenderingSettings settings( 180 PDFEngineExports::RenderingSettings settings(
177 dpi, dpi, pp::Rect(bitmap_width, bitmap_height), true, false, true, true, 181 dpi, dpi, pp::Rect(bitmap_width, bitmap_height), true, false, true,
178 autorotate); 182 true, autorotate);
179 bool ret = engine_exports->RenderPDFPageToBitmap( 183 bool ret = engine_exports->RenderPDFPageToBitmap(
180 pdf_buffer, pdf_buffer_size, page_number, settings, bitmap_buffer); 184 pdf_buffer, pdf_buffer_size, page_number, settings, bitmap_buffer);
181 if (!g_sdk_initialized_via_pepper) 185 if (!g_sdk_initialized_via_pepper)
182 ShutdownSDK(); 186 ShutdownSDK();
183 187
184 return ret; 188 return ret;
185 } 189 }
186 190
187 } // namespace chrome_pdf 191 } // namespace chrome_pdf
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698