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

Unified Diff: chrome/utility/printing_handler.cc

Issue 2970473002: Add generic text printing (Closed)
Patch Set: Address comment 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
Index: chrome/utility/printing_handler.cc
diff --git a/chrome/utility/printing_handler.cc b/chrome/utility/printing_handler.cc
index 83366b9a2f049d53199c29e0197c30073ff5dace..e7b24d057d05aaee778ca86f5f83539fb3f5561d 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::TEXTONLY;
+ break;
case PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2:
- postscript_level = 2;
+ printing_mode = chrome_pdf::PrintingMode::POSTSCRIPT2;
break;
case PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3:
- postscript_level = 3;
+ printing_mode = chrome_pdf::PrintingMode::POSTSCRIPT3;
break;
default:
- postscript_level = 0; // Not using postscript.
+ // Not using postscript or text only.
+ printing_mode = chrome_pdf::PrintingMode::EMF;
}
- 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') | pdf/pdf.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698