summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-08-07 21:45:34 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-07 21:45:34 +0000
commit3bee9c60f013b8b7e99c39ee35699d132b330334 (patch)
treefc00b16bf5c6b84af3c4683e43a2652b80db173b /public
parente1c2f6d7fe7a50280161832799550a3ee8f98088 (diff)
downloadpdfium-3bee9c60f013b8b7e99c39ee35699d132b330334.tar.xz
Add FPDFTextObj_GetText() API
Generalize CPDF_TextPage::GetTextByRect(), so that it's possible to get the text from a text page using a predicate, that way we can easily get the text that belongs to single text object as well. Change-Id: Ia457af0f41184694dc1481709be72b35685bce7f Reviewed-on: https://pdfium-review.googlesource.com/39530 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_edit.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h
index 4d5aa9c48a..83fedba905 100644
--- a/public/fpdf_edit.h
+++ b/public/fpdf_edit.h
@@ -1275,6 +1275,26 @@ FPDFTextObj_GetFontName(FPDF_PAGEOBJECT text,
unsigned long length);
// Experimental API.
+// Get the text of a text object.
+//
+// text_object - the handle to the text object.
+// text_page - the handle to the text page.
+// buffer - the address of a buffer that receives the text.
+// length - the size, in bytes, of |buffer|.
+//
+// Returns the number of bytes in the text (including the trailing NUL
+// character) on success, 0 on error.
+//
+// Regardless of the platform, the |buffer| is always in UTF16-LE encoding.
+// If |length| is less than the returned length, or |buffer| is NULL, |buffer|
+// will not be modified.
+FPDF_EXPORT unsigned long FPDF_CALLCONV
+FPDFTextObj_GetText(FPDF_PAGEOBJECT text_object,
+ FPDF_TEXTPAGE text_page,
+ void* buffer,
+ unsigned long length);
+
+// Experimental API.
// Get number of page objects inside |form_object|.
//
// form_object - handle to a form object.