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

Unified Diff: components/printing/renderer/print_web_view_helper.cc

Issue 2524143003: Print Preview: Add option to rasterize PDFs and add JPEG compression. (Closed)
Patch Set: Created 4 years, 1 month 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: components/printing/renderer/print_web_view_helper.cc
diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc
index e343eef72d49ef5518ae771d499f9e28bfa8d73e..e18c5d7bbe31820952a863b413295b0e0b8eacf2 100644
--- a/components/printing/renderer/print_web_view_helper.cc
+++ b/components/printing/renderer/print_web_view_helper.cc
@@ -285,6 +285,7 @@ void ComputeWebKitPrintParamsInDesiredDpi(
blink::WebPrintParams* webkit_print_params) {
int dpi = GetDPI(&print_params);
webkit_print_params->printerDPI = dpi;
+ webkit_print_params->rasterizePDF = print_params.rasterize_pdf;
webkit_print_params->printScalingOption = print_params.print_scaling_option;
webkit_print_params->printContentArea.width = ConvertUnit(
@@ -1693,6 +1694,8 @@ bool PrintWebViewHelper::UpdatePrintSettings(
modified_job_settings.SetInteger(kSettingMarginsType, NO_MARGINS);
job_settings = &modified_job_settings;
}
+ bool raster = false;
+ job_settings->GetBoolean(kSettingRasterizePdf, &raster);
// Send the cookie so that UpdatePrintSettings can reuse PrinterQuery when
// possible.

Powered by Google App Engine
This is Rietveld 408576698