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

Unified Diff: chrome/utility/printing_handler.cc

Issue 2970473002: Add generic text printing (Closed)
Patch Set: Change enum names 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/printing/print_view_manager_base.cc ('k') | pdf/pdf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/printing_handler.cc
diff --git a/chrome/utility/printing_handler.cc b/chrome/utility/printing_handler.cc
index 83366b9a2f049d53199c29e0197c30073ff5dace..42b343c4361a9d2bc6998b2408625b00d6132d0b 100644
--- a/chrome/utility/printing_handler.cc
+++ b/chrome/utility/printing_handler.cc
@@ -91,18 +91,22 @@ void PrintingHandler::OnRenderPDFPagesToMetafile(
pdf_rendering_settings_ = settings;
chrome_pdf::SetPDFUseGDIPrinting(pdf_rendering_settings_.mode ==
PdfRenderSettings::Mode::GDI_TEXT);
- int postscript_level;
+ int printing_mode;
switch (pdf_rendering_settings_.mode) {
+ case PdfRenderSettings::Mode::TEXTONLY:
+ printing_mode = chrome_pdf::PrintingMode::kTextOnly;
+ break;
case PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2:
- postscript_level = 2;
+ printing_mode = chrome_pdf::PrintingMode::kPostScript2;
break;
case PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3:
- postscript_level = 3;
+ printing_mode = chrome_pdf::PrintingMode::kPostScript3;
break;
default:
- postscript_level = 0; // Not using postscript.
+ // Not using postscript or text only.
+ printing_mode = chrome_pdf::PrintingMode::kEmf;
}
- chrome_pdf::SetPDFPostscriptPrintingLevel(postscript_level);
+ chrome_pdf::SetPDFUsePrintMode(printing_mode);
base::File pdf_file = IPC::PlatformFileForTransitToFile(pdf_transit);
int page_count = LoadPDF(std::move(pdf_file));
« no previous file with comments | « chrome/browser/printing/print_view_manager_base.cc ('k') | pdf/pdf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698