Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fpdf_text.cpp
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "public/fpdf_text.h"
8
9#include <algorithm>
10#include <limits>
11#include <memory>
12#include <vector>
13
14#include "build/build_config.h"
15#include "core/fpdfapi/font/cpdf_font.h"
16#include "core/fpdfapi/page/cpdf_page.h"
17#include "core/fpdfapi/page/cpdf_textobject.h"
18#include "core/fpdfdoc/cpdf_viewerpreferences.h"
19#include "core/fpdftext/cpdf_linkextract.h"
20#include "core/fpdftext/cpdf_textpage.h"
21#include "core/fpdftext/cpdf_textpagefind.h"
22#include "core/fxcrt/check_op.h"
23#include "core/fxcrt/compiler_specific.h"
24#include "core/fxcrt/fx_memcpy_wrappers.h"
25#include "core/fxcrt/numerics/safe_conversions.h"
26#include "core/fxcrt/span.h"
27#include "core/fxcrt/span_util.h"
28#include "core/fxcrt/stl_util.h"
29#include "fpdfsdk/cpdfsdk_helpers.h"
30
31namespace {
32
33CPDF_TextPage* GetTextPageForValidIndex(FPDF_TEXTPAGE text_page, int index) {
34 if (!text_page || index < 0)
35 return nullptr;
36
38 return static_cast<size_t>(index) < textpage->size() ? textpage : nullptr;
39}
40
41} // namespace
42
43FPDF_EXPORT FPDF_TEXTPAGE FPDF_CALLCONV FPDFText_LoadPage(FPDF_PAGE page) {
44 CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
45 if (!pPDFPage)
46 return nullptr;
47
49 auto textpage =
50 std::make_unique<CPDF_TextPage>(pPDFPage, viewRef.IsDirectionR2L());
51
52 // Caller takes ownership.
53 return FPDFTextPageFromCPDFTextPage(textpage.release());
54}
55
56FPDF_EXPORT void FPDF_CALLCONV FPDFText_ClosePage(FPDF_TEXTPAGE text_page) {
57 // PDFium takes ownership.
58 std::unique_ptr<CPDF_TextPage> textpage_deleter(
60}
61
62FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountChars(FPDF_TEXTPAGE text_page) {
64 return textpage ? textpage->CountChars() : -1;
65}
66
67FPDF_EXPORT unsigned int FPDF_CALLCONV
68FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index) {
69 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
70 if (!textpage)
71 return 0;
72
73 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
74 return charinfo.m_Unicode;
75}
76
77FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV
78FPDFText_GetTextObject(FPDF_TEXTPAGE text_page, int index) {
79 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
80 if (!textpage) {
81 return nullptr;
82 }
83
84 return FPDFPageObjectFromCPDFPageObject(
85 textpage->GetCharInfo(index).m_pTextObj);
86}
87
89 int index) {
90 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
91 if (!textpage)
92 return -1;
93
94 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
95 return charinfo.m_CharType == CPDF_TextPage::CharType::kGenerated ? 1 : 0;
96}
97
98FPDF_EXPORT int FPDF_CALLCONV FPDFText_IsHyphen(FPDF_TEXTPAGE text_page,
99 int index) {
100 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
101 if (!textpage) {
102 return -1;
103 }
104
105 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
107}
108
110FPDFText_HasUnicodeMapError(FPDF_TEXTPAGE text_page, int index) {
111 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
112 if (!textpage)
113 return -1;
114
115 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
117}
118
119FPDF_EXPORT double FPDF_CALLCONV FPDFText_GetFontSize(FPDF_TEXTPAGE text_page,
120 int index) {
121 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
122 if (!textpage)
123 return 0;
124
125 return textpage->GetCharFontSize(index);
126}
127
128FPDF_EXPORT unsigned long FPDF_CALLCONV
129FPDFText_GetFontInfo(FPDF_TEXTPAGE text_page,
130 int index,
131 void* buffer,
132 unsigned long buflen,
133 int* flags) {
134 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
135 if (!textpage)
136 return 0;
137
138 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
139 if (!charinfo.m_pTextObj)
140 return 0;
141
142 RetainPtr<CPDF_Font> font = charinfo.m_pTextObj->GetFont();
143 if (flags)
144 *flags = font->GetFontFlags();
145
146 // SAFETY: required from caller.
147 auto result_span = UNSAFE_BUFFERS(SpanFromFPDFApiArgs(buffer, buflen));
148 ByteString basefont = font->GetBaseFontName();
149 auto basefont_span = basefont.span_with_terminator();
150 fxcrt::try_spancpy(result_span, basefont_span);
151 return pdfium::checked_cast<unsigned long>(basefont_span.size());
152}
153
155 int index) {
156 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
157 if (!textpage)
158 return -1;
159
160 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
161 if (!charinfo.m_pTextObj)
162 return -1;
163
164 return charinfo.m_pTextObj->GetFont()->GetFontWeight();
165}
166
168FPDFText_GetFillColor(FPDF_TEXTPAGE text_page,
169 int index,
170 unsigned int* R,
171 unsigned int* G,
172 unsigned int* B,
173 unsigned int* A) {
174 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
175 if (!textpage || !R || !G || !B || !A)
176 return false;
177
178 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
179 if (!charinfo.m_pTextObj)
180 return false;
181
182 FX_COLORREF fill_color = charinfo.m_pTextObj->color_state().GetFillColorRef();
183 *R = FXSYS_GetRValue(fill_color);
184 *G = FXSYS_GetGValue(fill_color);
185 *B = FXSYS_GetBValue(fill_color);
186 *A = FXSYS_GetUnsignedAlpha(
187 charinfo.m_pTextObj->general_state().GetFillAlpha());
188 return true;
189}
190
192FPDFText_GetStrokeColor(FPDF_TEXTPAGE text_page,
193 int index,
194 unsigned int* R,
195 unsigned int* G,
196 unsigned int* B,
197 unsigned int* A) {
198 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
199 if (!textpage || !R || !G || !B || !A)
200 return false;
201
202 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
203 if (!charinfo.m_pTextObj)
204 return false;
205
206 FX_COLORREF stroke_color =
207 charinfo.m_pTextObj->color_state().GetStrokeColorRef();
208 *R = FXSYS_GetRValue(stroke_color);
209 *G = FXSYS_GetGValue(stroke_color);
210 *B = FXSYS_GetBValue(stroke_color);
211 *A = FXSYS_GetUnsignedAlpha(
212 charinfo.m_pTextObj->general_state().GetStrokeAlpha());
213 return true;
214}
215
216FPDF_EXPORT float FPDF_CALLCONV FPDFText_GetCharAngle(FPDF_TEXTPAGE text_page,
217 int index) {
218 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
219 if (!textpage)
220 return -1.0f;
221
222 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
223 // On the left is our current Matrix and on the right a generic rotation
224 // matrix for our coordinate space.
225 // | a b 0 | | cos(t) -sin(t) 0 |
226 // | c d 0 | | sin(t) cos(t) 0 |
227 // | e f 1 | | 0 0 1 |
228 // Calculate the angle of the vector
229 float angle = atan2f(charinfo.m_Matrix.c, charinfo.m_Matrix.a);
230 if (angle < 0)
231 angle = 2 * FXSYS_PI + angle;
232
233 return angle;
234}
235
236FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetCharBox(FPDF_TEXTPAGE text_page,
237 int index,
238 double* left,
239 double* right,
240 double* bottom,
241 double* top) {
242 if (!left || !right || !bottom || !top)
243 return false;
244
245 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
246 if (!textpage)
247 return false;
248
249 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
250 *left = charinfo.m_CharBox.left;
251 *right = charinfo.m_CharBox.right;
252 *bottom = charinfo.m_CharBox.bottom;
253 *top = charinfo.m_CharBox.top;
254 return true;
255}
256
258FPDFText_GetLooseCharBox(FPDF_TEXTPAGE text_page, int index, FS_RECTF* rect) {
259 if (!rect)
260 return false;
261
262 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
263 if (!textpage)
264 return false;
265
266 *rect = FSRectFFromCFXFloatRect(textpage->GetCharLooseBounds(index));
267 return true;
268}
269
270FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetMatrix(FPDF_TEXTPAGE text_page,
271 int index,
272 FS_MATRIX* matrix) {
273 if (!matrix)
274 return false;
275
276 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
277 if (!textpage)
278 return false;
279
280 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
281 *matrix = FSMatrixFromCFXMatrix(charinfo.m_Matrix);
282 return true;
283}
284
286FPDFText_GetCharOrigin(FPDF_TEXTPAGE text_page,
287 int index,
288 double* x,
289 double* y) {
290 CPDF_TextPage* textpage = GetTextPageForValidIndex(text_page, index);
291 if (!textpage)
292 return false;
293
294 const CPDF_TextPage::CharInfo& charinfo = textpage->GetCharInfo(index);
295 *x = charinfo.m_Origin.x;
296 *y = charinfo.m_Origin.y;
297 return true;
298}
299
301FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
302 double x,
303 double y,
304 double xTolerance,
305 double yTolerance) {
307 if (!textpage)
308 return -3;
309
310 return textpage->GetIndexAtPos(
311 CFX_PointF(static_cast<float>(x), static_cast<float>(y)),
312 CFX_SizeF(static_cast<float>(xTolerance),
313 static_cast<float>(yTolerance)));
314}
315
317 int start_index,
318 int char_count,
319 unsigned short* result) {
321 if (!textpage || start_index < 0 || char_count < 0 || !result) {
322 return 0;
323 }
324 int char_available = textpage->CountChars() - start_index;
325 if (char_available <= 0) {
326 return 0;
327 }
328 char_count = std::min(char_count, char_available);
329 if (char_count == 0) {
330 // Writing out "", which has a character count of 1 due to the NUL.
331 *result = '\0';
332 return 1;
333 }
334 // SAFETY: Required from caller. Public API description states that
335 // `result` must be able to hold `char_count` characters plus a
336 // terminator.
337 CHECK_LT(char_count, std::numeric_limits<int>::max());
338 pdfium::span<unsigned short> result_span =
339 UNSAFE_BUFFERS(pdfium::make_span(result, char_count + 1));
340
341 // Includes two-byte terminator in string data itself.
342 ByteString str = textpage->GetPageText(start_index, char_count).ToUCS2LE();
343 auto str_span = fxcrt::reinterpret_span<const unsigned short>(str.span());
344
345 // Hard CHECK() in Copy() if retrieved text is too long.
346 fxcrt::Copy(str_span, result_span);
347 return pdfium::checked_cast<int>(str_span.size());
348}
349
351 int start,
352 int count) {
354 return textpage ? textpage->CountRects(start, count) : 0;
355}
356
357FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page,
358 int rect_index,
359 double* left,
360 double* top,
361 double* right,
362 double* bottom) {
364 if (!textpage)
365 return false;
366
367 CFX_FloatRect rect;
368 bool result = textpage->GetRect(rect_index, &rect);
369
370 *left = rect.left;
371 *top = rect.top;
372 *right = rect.right;
373 *bottom = rect.bottom;
374 return result;
375}
376
378 double left,
379 double top,
380 double right,
381 double bottom,
382 unsigned short* buffer,
383 int buflen) {
385 if (!textpage) {
386 return 0;
387 }
388 CFX_FloatRect rect((float)left, (float)bottom, (float)right, (float)top);
389 WideString wstr = textpage->GetTextByRect(rect);
390 if (buflen <= 0 || !buffer) {
391 return pdfium::checked_cast<int>(wstr.GetLength());
392 }
393
394 // SAFETY: Required from caller. Public API states that buflen
395 // describes the number of values buffer can hold.
396 const auto buffer_span = UNSAFE_BUFFERS(pdfium::make_span(buffer, buflen));
397
398 ByteString str = wstr.ToUTF16LE();
399 pdfium::span<const char> str_span = str.span();
400 auto copy_span = fxcrt::reinterpret_span<const unsigned short>(str_span);
401 if (copy_span.size() > buffer_span.size()) {
402 copy_span = copy_span.first(buffer_span.size());
403 }
404 fxcrt::Copy(copy_span, buffer_span);
405 return pdfium::checked_cast<int>(copy_span.size());
406}
407
408FPDF_EXPORT FPDF_SCHHANDLE FPDF_CALLCONV
409FPDFText_FindStart(FPDF_TEXTPAGE text_page,
410 FPDF_WIDESTRING findwhat,
411 unsigned long flags,
412 int start_index) {
414 if (!textpage)
415 return nullptr;
416
417 CPDF_TextPageFind::Options options;
418 options.bMatchCase = !!(flags & FPDF_MATCHCASE);
419 options.bMatchWholeWord = !!(flags & FPDF_MATCHWHOLEWORD);
420 options.bConsecutive = !!(flags & FPDF_CONSECUTIVE);
421
422 // SAFETY: required from caller.
423 auto find = CPDF_TextPageFind::Create(
424 textpage, UNSAFE_BUFFERS(WideStringFromFPDFWideString(findwhat)), options,
425 start_index >= 0 ? std::optional<size_t>(start_index) : std::nullopt);
426
427 // Caller takes ownership.
428 return FPDFSchHandleFromCPDFTextPageFind(find.release());
429}
430
431FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindNext(FPDF_SCHHANDLE handle) {
432 if (!handle)
433 return false;
434
436 return textpageFind->FindNext();
437}
438
439FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindPrev(FPDF_SCHHANDLE handle) {
440 if (!handle)
441 return false;
442
444 return textpageFind->FindPrev();
445}
446
448FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle) {
449 if (!handle)
450 return 0;
451
453 return textpageFind->GetCurOrder();
454}
455
457 if (!handle)
458 return 0;
459
461 return textpageFind->GetMatchedCount();
462}
463
464FPDF_EXPORT void FPDF_CALLCONV FPDFText_FindClose(FPDF_SCHHANDLE handle) {
465 if (!handle)
466 return;
467
468 // Take ownership back from caller and destroy.
469 std::unique_ptr<CPDF_TextPageFind> textpageFind(
471}
472
473// web link
474FPDF_EXPORT FPDF_PAGELINK FPDF_CALLCONV
475FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page) {
477 if (!textpage)
478 return nullptr;
479
480 auto pagelink = std::make_unique<CPDF_LinkExtract>(textpage);
481 pagelink->ExtractLinks();
482
483 // Caller takes ownership.
484 return FPDFPageLinkFromCPDFLinkExtract(pagelink.release());
485}
486
488 if (!link_page)
489 return 0;
490
492 return pdfium::checked_cast<int>(pageLink->CountLinks());
493}
494
495FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetURL(FPDF_PAGELINK link_page,
496 int link_index,
497 unsigned short* buffer,
498 int buflen) {
499 WideString wsUrl(L"");
500 if (link_page && link_index >= 0) {
502 wsUrl = pageLink->GetURL(link_index);
503 }
504 ByteString cbUTF16URL = wsUrl.ToUTF16LE();
505 auto url_span =
506 fxcrt::reinterpret_span<const unsigned short>(cbUTF16URL.span());
507 if (!buffer || buflen <= 0) {
508 return pdfium::checked_cast<int>(url_span.size());
509 }
510
511 // SAFETY: required from caller.
512 pdfium::span<unsigned short> result_span =
513 UNSAFE_BUFFERS(pdfium::make_span(buffer, buflen));
514
515 size_t size = std::min(url_span.size(), result_span.size());
516 fxcrt::Copy(url_span.first(size), result_span);
517 return pdfium::checked_cast<int>(size);
518}
519
521 int link_index) {
522 if (!link_page || link_index < 0)
523 return 0;
524
526 return fxcrt::CollectionSize<int>(pageLink->GetRects(link_index));
527}
528
529FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetRect(FPDF_PAGELINK link_page,
530 int link_index,
531 int rect_index,
532 double* left,
533 double* top,
534 double* right,
535 double* bottom) {
536 if (!link_page || link_index < 0 || rect_index < 0)
537 return false;
538
540 std::vector<CFX_FloatRect> rectArray = pageLink->GetRects(link_index);
541 if (rect_index >= fxcrt::CollectionSize<int>(rectArray))
542 return false;
543
544 *left = rectArray[rect_index].left;
545 *right = rectArray[rect_index].right;
546 *top = rectArray[rect_index].top;
547 *bottom = rectArray[rect_index].bottom;
548 return true;
549}
550
552FPDFLink_GetTextRange(FPDF_PAGELINK link_page,
553 int link_index,
554 int* start_char_index,
555 int* char_count) {
556 if (!link_page || link_index < 0)
557 return false;
558
560 auto maybe_range = page_link->GetTextRange(link_index);
561 if (!maybe_range.has_value())
562 return false;
563
564 *start_char_index = pdfium::checked_cast<int>(maybe_range.value().m_Start);
565 *char_count = pdfium::checked_cast<int>(maybe_range.value().m_Count);
566 return true;
567}
568
569FPDF_EXPORT void FPDF_CALLCONV FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) {
570 delete CPDFLinkExtractFromFPDFPageLink(link_page);
571}
fxcrt::ByteString ByteString
Definition bytestring.h:180
#define CHECK_LT(x, y)
Definition check_op.h:12
constexpr CFX_FloatRect(float l, float b, float r, float t)
CPDF_Document * GetDocument() const override
Definition cpdf_page.cpp:51
bool GetRect(int rectIndex, CFX_FloatRect *pRect) const
int CountChars() const
WideString GetTextByRect(const CFX_FloatRect &rect) const
int GetIndexAtPos(const CFX_PointF &point, const CFX_SizeF &tolerance) const
int CountRects(int start, int nCount)
WideString GetPageText(int start, int count) const
CPDF_ViewerPreferences(const CPDF_Document *pDoc)
WideString(const wchar_t *ptr)
ByteString ToUCS2LE() const
ByteString ToUTF16LE() const
#define UNSAFE_BUFFERS(...)
CPDF_TextPageFind * CPDFTextPageFindFromFPDFSchHandle(FPDF_SCHHANDLE handle)
CPDF_TextPage * CPDFTextPageFromFPDFTextPage(FPDF_TEXTPAGE page)
FS_MATRIX FSMatrixFromCFXMatrix(const CFX_Matrix &matrix)
CPDF_Page * CPDFPageFromFPDFPage(FPDF_PAGE page)
CPDF_LinkExtract * CPDFLinkExtractFromFPDFPageLink(FPDF_PAGELINK link)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetStrokeColor(FPDF_TEXTPAGE text_page, int index, unsigned int *R, unsigned int *G, unsigned int *B, unsigned int *A)
FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle)
FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetURL(FPDF_PAGELINK link_page, int link_index, unsigned short *buffer, int buflen)
FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetText(FPDF_TEXTPAGE page, int start_index, int char_count, unsigned short *result)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetTextRange(FPDF_PAGELINK link_page, int link_index, int *start_char_index, int *char_count)
FPDF_EXPORT int FPDF_CALLCONV FPDFText_IsGenerated(FPDF_TEXTPAGE text_page, int index)
Definition fpdf_text.cpp:88
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetCharOrigin(FPDF_TEXTPAGE text_page, int index, double *x, double *y)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetFillColor(FPDF_TEXTPAGE text_page, int index, unsigned int *R, unsigned int *G, unsigned int *B, unsigned int *A)
FPDF_EXPORT int FPDF_CALLCONV FPDFText_IsHyphen(FPDF_TEXTPAGE text_page, int index)
Definition fpdf_text.cpp:98
FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, double x, double y, double xTolerance, double yTolerance)
FPDF_EXPORT void FPDF_CALLCONV FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page)
FPDF_EXPORT float FPDF_CALLCONV FPDFText_GetCharAngle(FPDF_TEXTPAGE text_page, int index)
FPDF_EXPORT int FPDF_CALLCONV FPDFText_HasUnicodeMapError(FPDF_TEXTPAGE text_page, int index)
FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page, double left, double top, double right, double bottom, unsigned short *buffer, int buflen)
FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountRects(FPDF_PAGELINK link_page, int link_index)
FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetFontWeight(FPDF_TEXTPAGE text_page, int index)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetLooseCharBox(FPDF_TEXTPAGE text_page, int index, FS_RECTF *rect)
FPDF_EXPORT double FPDF_CALLCONV FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, int index)
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFText_GetTextObject(FPDF_TEXTPAGE text_page, int index)
Definition fpdf_text.cpp:78
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, int index, double *left, double *right, double *bottom, double *top)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetRect(FPDF_PAGELINK link_page, int link_index, int rect_index, double *left, double *top, double *right, double *bottom)
FPDF_EXPORT void FPDF_CALLCONV FPDFText_FindClose(FPDF_SCHHANDLE handle)
FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountRects(FPDF_TEXTPAGE text_page, int start, int count)
FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountChars(FPDF_TEXTPAGE text_page)
Definition fpdf_text.cpp:62
FPDF_EXPORT FPDF_TEXTPAGE FPDF_CALLCONV FPDFText_LoadPage(FPDF_PAGE page)
Definition fpdf_text.cpp:43
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindPrev(FPDF_SCHHANDLE handle)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetMatrix(FPDF_TEXTPAGE text_page, int index, FS_MATRIX *matrix)
FPDF_EXPORT void FPDF_CALLCONV FPDFText_ClosePage(FPDF_TEXTPAGE text_page)
Definition fpdf_text.cpp:56
FPDF_EXPORT FPDF_PAGELINK FPDF_CALLCONV FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFText_GetFontInfo(FPDF_TEXTPAGE text_page, int index, void *buffer, unsigned long buflen, int *flags)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page, int rect_index, double *left, double *top, double *right, double *bottom)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindNext(FPDF_SCHHANDLE handle)
FPDF_EXPORT FPDF_SCHHANDLE FPDF_CALLCONV FPDFText_FindStart(FPDF_TEXTPAGE text_page, FPDF_WIDESTRING findwhat, unsigned long flags, int start_index)
FPDF_EXPORT unsigned int FPDF_CALLCONV FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index)
Definition fpdf_text.cpp:68
FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchCount(FPDF_SCHHANDLE handle)
FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountWebLinks(FPDF_PAGELINK link_page)
#define FPDF_MATCHWHOLEWORD
Definition fpdf_text.h:485
#define FPDF_CONSECUTIVE
Definition fpdf_text.h:487
#define FPDF_MATCHCASE
Definition fpdf_text.h:483
#define FPDF_CALLCONV
Definition fpdfview.h:229
#define FPDF_EXPORT
Definition fpdfview.h:223
uint32_t FX_COLORREF
Definition fx_dib.h:42
constexpr uint8_t FXSYS_GetRValue(uint32_t bgr)
Definition fx_dib.h:143
constexpr uint8_t FXSYS_GetGValue(uint32_t bgr)
Definition fx_dib.h:147
constexpr uint8_t FXSYS_GetBValue(uint32_t bgr)
Definition fx_dib.h:151
#define FXSYS_PI
Definition fx_system.h:44
fxcrt::WideString WideString
Definition widestring.h:207