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 |