diff options
Diffstat (limited to 'vcl/source/pdf')
-rw-r--r-- | vcl/source/pdf/PDFiumLibrary.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx index 278fb284901d..c14a73ddd469 100644 --- a/vcl/source/pdf/PDFiumLibrary.cxx +++ b/vcl/source/pdf/PDFiumLibrary.cxx @@ -24,6 +24,7 @@ #include <osl/endian.h> #include <vcl/bitmap.hxx> #include <tools/stream.hxx> +#include <tools/UnitConversion.hxx> #include <bitmap/BitmapWriteAccess.hxx> @@ -1120,6 +1121,26 @@ PDFiumTextPage::~PDFiumTextPage() int PDFiumTextPage::countChars() { return FPDFText_CountChars(mpTextPage); } +basegfx::B2DRectangle PDFiumTextPage::getCharBox(int nIndex, double fPageHeight) +{ + double left = 0.0; + double right = 0.0; + double bottom = 0.0; + double top = 0.0; + + if (FPDFText_GetCharBox(mpTextPage, nIndex, &left, &right, &bottom, &top)) + { + left = convertPointToMm100(left); + right = convertPointToMm100(right); + top = fPageHeight - convertPointToMm100(top); + bottom = fPageHeight - convertPointToMm100(bottom); + + return basegfx::B2DRectangle(left, bottom, right, top); + } + + return basegfx::B2DRectangle(); +} + unsigned int PDFiumTextPage::getUnicode(int index) { return FPDFText_GetUnicode(mpTextPage, index); |