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

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: Change to match new Pdfium API Created 4 years 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 afb07fb24cba8e28f067b2878df375947169798a..a0c7cc4a41a286ded90f8abefb4f8338b93c0493 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(
@@ -1724,6 +1725,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