Method GetWords
- Namespace
- BitMiracle.Docotic.Pdf
- Assembly
- BitMiracle.Docotic.Pdf.dll
GetWords()
Retrieves collection of all words drawn on the page with their bounding rectangles.
public PdfCollection<PdfTextData> GetWords()
Returns
- PdfCollection<PdfTextData>
Collection of all words drawn on the page with their bounding rectangles.
Remarks
This method is useful if you want to highlight a word on the page or if you want to cover some words with a colored rectangle.
You can check the following conditions to detect whether an extracted word is visible on the page:
- Layer should be absent or visible.
- RenderingMode should not be equal to NeitherFillNorStroke or AddToPath.
- Bounds should fit into the corresponding ClipRegion. You can use IsVisible(PdfRectangle) method for this check.
- If you know the background color of the page, then you may check that the word color is different. You can use Brush and/or Pen properties depending on the RenderingMode.
Read the Extract detailed text information for an example of using text data.