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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 981843003: Printing: PDFs should only be fit to page if there is a size mismatch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pdf169120
Patch Set: rebase Created 5 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 | « pdf/pdfium/pdfium_engine.h ('k') | ppapi/c/private/ppp_pdf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index ddc1696857d5d384e128a4389bf2fc29eec1cf79..76a5c27732126f9d54ce171e403d10bb5563dc3f 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -2461,6 +2461,24 @@ int PDFiumEngine::GetDuplexType() {
return static_cast<int>(FPDF_VIEWERREF_GetDuplex(doc_));
}
+bool PDFiumEngine::GetPageSizeAndUniformity(pp::Size* size) {
+ if (pages_.empty())
+ return false;
+
+ pp::Size page_size = GetPageSize(0);
+ for (size_t i = 1; i < pages_.size(); ++i) {
+ if (page_size != GetPageSize(i))
+ return false;
+ }
+
+ // Convert |page_size| back to points.
+ size->set_width(
+ ConvertUnit(page_size.width(), kPixelsPerInch, kPointsPerInch));
+ size->set_height(
+ ConvertUnit(page_size.height(), kPixelsPerInch, kPointsPerInch));
+ return true;
+}
+
void PDFiumEngine::AppendBlankPages(int num_pages) {
DCHECK(num_pages != 0);
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | ppapi/c/private/ppp_pdf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698