Hello,
Thanks for your inquiry.
The findText method you currently use will be deprecated in the future, and in the latest version of
Spire.Pdf 8.8.6, there is taking a new method to find text, you can refer to the following code. If you don’t use the latest version of Spire.Pdf, please update to the latest version and use the new method to find text. If your issue still exists, please offer the following message, thanks for your assistance in advance.
1) Your input Pdf file.
2) Your full test code that can reproduce your issue.
3) The screenshot shown your issue.
4) Application type, such as Console App, .NET Framework 4.8.
5) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
- Code: Select all
PdfDocument doc = new PdfDocument();
// Read a pdf file
doc.LoadFromFile(input);
for (int i = 0;i<doc.Pages.Count;i++) {
PdfPageBase page = doc.Pages[i];
PdfTextFinder finder = new PdfTextFinder(page);
// Create PdfTextFindCollection object to find text
List<PdfTextFragment> collection = finder.Find("test");
foreach (PdfTextFragment find in collection) {
RectangleF rec = find.Bounds[0];
}
}
Sincerely
Abel
E-iceblue support team