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

Side by Side Diff: pdf/pdfium/pdfium_engine.cc

Issue 2970473002: Add generic text printing (Closed)
Patch Set: Clean up Created 3 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/pdfium/pdfium_engine.h" 5 #include "pdf/pdfium/pdfium_engine.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 4104 matching lines...) Expand 10 before | Expand all | Expand 10 after
4115 void PDFiumEngineExports::SetPDFEnsureTypefaceCharactersAccessible( 4115 void PDFiumEngineExports::SetPDFEnsureTypefaceCharactersAccessible(
4116 PDFEnsureTypefaceCharactersAccessible func) { 4116 PDFEnsureTypefaceCharactersAccessible func) {
4117 FPDF_SetTypefaceAccessibleFunc( 4117 FPDF_SetTypefaceAccessibleFunc(
4118 reinterpret_cast<PDFiumEnsureTypefaceCharactersAccessible>(func)); 4118 reinterpret_cast<PDFiumEnsureTypefaceCharactersAccessible>(func));
4119 } 4119 }
4120 4120
4121 void PDFiumEngineExports::SetPDFUseGDIPrinting(bool enable) { 4121 void PDFiumEngineExports::SetPDFUseGDIPrinting(bool enable) {
4122 FPDF_SetPrintTextWithGDI(enable); 4122 FPDF_SetPrintTextWithGDI(enable);
4123 } 4123 }
4124 4124
4125 void PDFiumEngineExports::SetPDFUseTextOnlyPrinting(bool enable) {
4126 FPDF_SetPrintTextOnly(enable);
4127 }
4128
4125 void PDFiumEngineExports::SetPDFPostscriptPrintingLevel(int postscript_level) { 4129 void PDFiumEngineExports::SetPDFPostscriptPrintingLevel(int postscript_level) {
4126 FPDF_SetPrintPostscriptLevel(postscript_level); 4130 FPDF_SetPrintPostscriptLevel(postscript_level);
4127 } 4131 }
4128 4132
4129 #endif // defined(OS_WIN) 4133 #endif // defined(OS_WIN)
4130 4134
4131 bool PDFiumEngineExports::RenderPDFPageToBitmap( 4135 bool PDFiumEngineExports::RenderPDFPageToBitmap(
4132 const void* pdf_buffer, 4136 const void* pdf_buffer,
4133 int pdf_buffer_size, 4137 int pdf_buffer_size,
4134 int page_number, 4138 int page_number,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
4198 FPDF_DOCUMENT doc = 4202 FPDF_DOCUMENT doc =
4199 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); 4203 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr);
4200 if (!doc) 4204 if (!doc)
4201 return false; 4205 return false;
4202 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; 4206 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0;
4203 FPDF_CloseDocument(doc); 4207 FPDF_CloseDocument(doc);
4204 return success; 4208 return success;
4205 } 4209 }
4206 4210
4207 } // namespace chrome_pdf 4211 } // namespace chrome_pdf
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698