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

Unified Diff: pdf/pdf.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: Browsertest modifies bitmap to fit in larger PNGs. 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
Index: pdf/pdf.cc
diff --git a/pdf/pdf.cc b/pdf/pdf.cc
index a4997a582dc35c4ad6dd763ab17dc39e86f05dc5..95987c4ade026ff514e636404fe4f429021a0739 100644
--- a/pdf/pdf.cc
+++ b/pdf/pdf.cc
@@ -199,6 +199,27 @@ bool GetPDFDocInfo(const void* pdf_buffer,
return ret;
}
+PDF_USED PP_EXPORT
+bool GetPDFPageSizeByIndex(const void* pdf_buffer,
+ int buffer_size, int index,
+ double* width, double* height) {
+ if (!g_sdk_initialized_via_pepper) {
+ void* data = NULL;
+#if defined(OS_WIN)
+ data = g_hmodule;
+#endif
+ if (!chrome_pdf::InitializeSDK(data))
+ return false;
+ }
+ scoped_ptr<chrome_pdf::PDFEngineExports> engine_exports(
+ chrome_pdf::PDFEngineExports::Create());
+ bool ret = engine_exports->GetPDFPageSizeByIndex(
+ pdf_buffer, buffer_size, index, width, height);
+ if (!g_sdk_initialized_via_pepper)
+ chrome_pdf::ShutdownSDK();
+ return ret;
+}
+
// Renders PDF page into 4-byte per pixel BGRA color bitmap.
// |pdf_buffer| is the buffer that contains the entire PDF document to be
// rendered.

Powered by Google App Engine
This is Rietveld 408576698