 |
PdfToTextGetWords Method |
Namespace: SelectPdf.UniversalAssembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.6
Syntaxpublic PdfTextWord[] GetWords()
Public Function GetWords As PdfTextWord()
Return Value
PdfTextWordThe words of the pages, page by page in reading order; an empty array when they hold no
text.
Remarks
The words are read the way
GetText reads the text in
Reading
layout: columns one after the other, a right-to-left line from its right end, vertical writing as
columns. Coordinates are in points from the top-left corner of the page, as for
Search(String).
ClipText applies: with it set, text outside the page is
left out.
ExamplePdfToText tool = new PdfToText();
tool.Load("document.pdf");
foreach (PdfTextWord word in tool.GetWords())
if (word.FontSize >= 18)
System.Console.WriteLine("page " + word.PageNumber + ": " + word.Text);
tool.Close();Dim tool As New PdfToText()
tool.Load("document.pdf")
For Each word As PdfTextWord In tool.GetWords()
If word.FontSize >= 18 Then System.Console.WriteLine("page " & word.PageNumber & ": " & word.Text)
Next
tool.Close()
See Also