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

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 214243006: Minimal patch to add rotation to PWG raster generation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « no previous file | chrome/utility/cloud_print/pwg_encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/chrome_content_utility_client.cc
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc
index f7274ed93d2cde1ffd45a370fd9fe1796783f2d2..c27a74968b3912fcc7a354beac467b54d26c0b79 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -720,6 +720,14 @@ bool ChromeContentUtilityClient::RenderPDFPagesToPWGRaster(
page_number = total_page_count - 1 - page_number;
}
+ bool rotate = false;
+
+ // Transform odd pages.
+ if (page_number % 2) {
+ rotate =
+ (bitmap_settings.odd_page_transform != printing::TRANSFORM_NORMAL);
+ }
+
if (!g_pdf_lib.Get().RenderPDFPageToBitmap(data.data(),
data.size(),
page_number,
@@ -732,7 +740,8 @@ bool ChromeContentUtilityClient::RenderPDFPagesToPWGRaster(
return false;
}
std::string pwg_page;
- if (!encoder.EncodePage(image, settings.dpi(), total_page_count, &pwg_page))
+ if (!encoder.EncodePage(
+ image, settings.dpi(), total_page_count, &pwg_page, rotate))
return false;
bytes_written = base::WritePlatformFileAtCurrentPos(bitmap_file,
pwg_page.data(),
« no previous file with comments | « no previous file | chrome/utility/cloud_print/pwg_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698