我想讓我的代碼在 pdf 或影像中找到文本的 xy 位置,以便我可以裁剪影像,這樣我就可以包含問題中包含的任何圖表(由一個影像組成文本放在上面),我目前正在使用來自 syncfusion 的 EJ2.PdfViewer,但我很高興使用其他對我的目的更有用的包。
如果有幫助,我的測驗代碼供參考:
Imports System
Imports Syncfusion.EJ2.PdfViewer
Module Program
Sub Main(args As String())
Dim extraction As PdfRenderer = New PdfRenderer()
extraction.Load("C:\math.pdf")
Dim textCollection As List(Of TextData) = New List(Of TextData)
Dim text As String = extraction.ExtractText(44, textCollection)
Console.WriteLine(text)
End Sub
End Module
uj5u.com熱心網友回復:
要獲取 pdf 中文本的位置,您可以使用一些庫:
- iText7:https ://itextpdf.com/resources/api-documentation
- 尖頂 PDF:https ://www.e-iceblue.com/Introduce/pdf-for-net-introduce.html
要獲取影像中文本的位置:
- 谷歌視覺 API:https ://cloud.google.com/vision/docs/ocr
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/521460.html
