2021年8月27日 星期五

[研究]warning CS0618: 'PdfTextFind.Bounds' 已經過時: 'This property may be removed in the future, please use TextBounds instead.'

[研究]warning CS0618: 'PdfTextFind.Bounds' 已經過時: 'This property may be removed in the future, please use TextBounds instead.'

2021-08-26

今天 Visual Studio 2019 編譯某方案時,出現

warning CS0618: 'PdfTextFind.Bounds' 已經過時: 'This property may be removed in the future, please use TextBounds instead.'

似乎是 NuGet 升級 PdfTextFind 版本的關係。packages.conf 顯示目前為 FreeSpire.PDF 7.8.9

PdfTextFind Class
Assembly: Spire.Pdf (in Spire.Pdf.dll) Version: 6.2.6.0 (6.2.6.2020)
https://www.e-iceblue.com/api_documents/5e4e0b69721393-11731598/res/html/d337da17-db94-256c-1fe8-b08d2796720c.htm

官方網頁說明依然 6.2.60 版,依然是用 Bounds,沒有 TextBounds 用法。找了一下

 rec = find.Bounds;

要改成

rec = find.TextBounds[0];

(完)

沒有留言:

張貼留言