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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 376083002: Export a function from the PDF plugin to get the dimensions of a PDF page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Redid comments to conform to the style of existing comment. Rename parameters for same reason. Created 6 years, 5 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/pdf_engine.h ('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 c1203bb74bca41fc65c6d15fc0eb80c4867dd07c..e66c12a6c9f1177247eed5f905e87412dbfddb8f 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -3406,4 +3406,18 @@ bool PDFiumEngineExports::GetPDFDocInfo(const void* pdf_buffer,
return true;
}
+bool PDFiumEngineExports::GetPDFPageSizeByIndex(
+ const void* pdf_buffer,
+ int pdf_buffer_size,
+ int page_number,
+ double* width,
+ double* height) {
+ FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL);
+ if (!doc)
+ return false;
+ bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0;
+ FPDF_CloseDocument(doc);
+ return success;
+}
+
} // namespace chrome_pdf
« pdf/pdf_engine.h ('K') | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698