From f1697fa06b9fae75dd1c0782f5a721795cfc4a0c Mon Sep 17 00:00:00 2001 From: wileyrya Date: Fri, 26 May 2017 12:27:40 -0500 Subject: Add public API for getting the bounds of a page object. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG=pdfium:721 R=npm@chromium.org Change-Id: I71b6281346b3ed67f6b8703eccd7794588559819 Reviewed-on: https://pdfium-review.googlesource.com/6013 Commit-Queue: Nicolás Peña Reviewed-by: Nicolás Peña --- fpdfsdk/fpdfeditpage.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp index 2c58caf6db..37469ed23a 100644 --- a/fpdfsdk/fpdfeditpage.cpp +++ b/fpdfsdk/fpdfeditpage.cpp @@ -320,3 +320,20 @@ FPDF_BOOL FPDFPageObj_SetFillColor(FPDF_PAGEOBJECT page_object, CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3); return true; } + +DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_GetBounds(FPDF_PAGEOBJECT pageObject, + float* left, + float* bottom, + float* right, + float* top) { + if (!pageObject) + return false; + + CPDF_PageObject* pPageObj = static_cast(pageObject); + CFX_FloatRect bbox = pPageObj->GetRect(); + *left = bbox.left; + *bottom = bbox.bottom; + *right = bbox.right; + *top = bbox.top; + return true; +} -- cgit v1.2.3