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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 335583004: Added a test that currently is able to print to pdf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored print_preview.js and the browsertest. Made browsertest multiplatform compatible. Created 6 years, 6 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
« pdf/libpdf.map ('K') | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | 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 45651319d29051a840585cdc2076b9e225458e68..7c8c626bbb84dc562b50521525820a8ffb7cd5dd 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -3384,4 +3384,25 @@ bool PDFiumEngineExports::GetPDFDocInfo(const void* pdf_buffer,
return true;
}
+bool PDFiumEngineExports::GetPDFPageSizeByIndex(
+ const void* pdf_buffer,
+ int buffer_size,
+ int index,
+ double* width,
+ double* height) {
+ FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, buffer_size, NULL);
+ bool ret_value;
+
+ if (!doc)
+ return false;
+
+ if (!FPDF_GetPageSizeByIndex(doc, index, width, height))
+ ret_value = false;
+
+ FPDF_CloseDocument(doc);
+ ret_value = true;
Dan Beam 2014/07/07 23:08:12 just always return true, ret_value is always overw
ivandavid 2014/07/08 01:07:42 Done.
ivandavid 2014/07/08 01:07:42 Oops. Didn't mean to assign it to true there. It a
Lei Zhang 2014/07/08 01:11:37 I think what you want is: if (!doc) return fals
Dan Beam 2014/07/08 04:25:13 if we're gonna keep this code, s/retval ==/success
ivandavid 2014/07/08 23:24:21 Done.
+
+ return ret_value;
+}
+
} // namespace chrome_pdf
« pdf/libpdf.map ('K') | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698