diff options
author | John Abd-El-Malek <jam@chromium.org> | 2015-02-25 11:08:16 -0800 |
---|---|---|
committer | John Abd-El-Malek <jam@chromium.org> | 2015-02-25 11:08:16 -0800 |
commit | 8a7b669e3d3f3415fd1cf3da833089fe711078a8 (patch) | |
tree | 5d817d346a7c388b50483e083d28ce94f181f203 | |
parent | d8bc3d5ff28248bd9c1189cf1942134dea38d673 (diff) | |
download | pdfium-8a7b669e3d3f3415fd1cf3da833089fe711078a8.tar.xz |
Merge https://codereview.chromium.org/935663003/ to XFA branch.
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/946103003
-rw-r--r-- | samples/pdfium_test.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc index 10515946b3..d861f2f5c9 100644 --- a/samples/pdfium_test.cc +++ b/samples/pdfium_test.cc @@ -501,14 +501,12 @@ void RenderPdf(const std::string& name, const char* pBuf, size_t len, FORM_OnAfterLoadPage(page, form); FORM_DoPageAAction(page, form, FPDFPAGE_AACTION_OPEN); - int width = static_cast<int>(FPDF_GetPageWidth(page)); - int height = static_cast<int>(FPDF_GetPageHeight(page)); + double scale = 1.0; if (!options.scale_factor_as_string.empty()) { - double scale = 1.0; std::stringstream(options.scale_factor_as_string) >> scale; - width *= scale; - height *= scale; } + int width = static_cast<int>(FPDF_GetPageWidth(page) * scale); + int height = static_cast<int>(FPDF_GetPageHeight(page) * scale); FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, 0); FPDFBitmap_FillRect(bitmap, 0, 0, width, height, 0xFFFFFFFF); |