pdfBuildWordListFromRect2
Construct a word list for a rectangular region.
void pdfBuildWordListFromRect2(PDFHandle pdf, int page,
double x0, double y0, double x1, double y1)
This function constructs a word list for a rectangular region of a
page.
The rectangle is defined by two opposite corners: (x0,
y0)
and (x1, y1)
. The coordinates are in PDF
coordinate space.
After building a word list, call pdfGetNumWords
and pdfGetWord
to access the words.
XpdfText holds a word list for one page or region at a time. If you
call pdfBuildWordList
or pdfBuildWordListFromRect2
again, the new word list will replace the previous one.
Word ordering within the word list is affected by the text extraction mode - see the "Setting parameters" section in the function list.
C:
/* make word list for (200,300)-(500,400) on page 1 */
pdfBuildWordListFromRect2(pdf, 1, 200, 300, 500, 400);