DynaPDF Manual - Page 60

Previous Page 59   Index   Next Page 61

Content parsing & editing
Page 60 of 860
TTextSelection* next = &Curr;
while (next)
{
if (psrGetSelBBox2(PDF, next, q))
{
if (fabs(q[0].y - q[3].y) < 0.0001f) // Is this a rotated node?
pdfRectangle(PDF, q[0].x, q[0].y, q[3].x-q[0].x, q[1].y-q[0].y, fmStroke);
else
{
pdfMoveTo(PDF, q[0].x, q[0].y);
pdfLineTo(PDF, q[1].x, q[1].y);
pdfLineTo(PDF, q[2].x, q[2].y);
pdfLineTo(PDF, q[3].x, q[3].y);
pdfClosePath(PDF, fmStroke);
}
}
next = next->Next;
}
}
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
GetSelText
Syntax:
LBOOL psrGetSelText(
const PPDF* IPDF,
// PDF instance pointer
struct TTextSelection* SelText, // Required. Structure filled with
// data by FindText().
UI16** Text,
// Address of UI16* variable
UI32* TextLen)
// Address of UI32 variable
The function retrieves the text and text length of the current selection or found text.
This function is mainly a helper function for programming languages which do not support
pointers like VB 6, VB .Net, C#, and so on. However, the function is also useful if FindText() was
called with the search type stMatchAlways. In this case, and only in this case, it is not known
which text FindText() has found.
In C/C++, or Delphi you can access the text directly as follows:
UI16* text
= selText->TextOP->Text->UniText;
UI32 textLen = selText->TextOP->Text->UniTextLength;
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
 

Previous topic: GetSelBBox2

Next topic: ParsePage