c# - 如何在 C# 中使用 Google Vision API 提取 PDF 文本
问题描述
我想使用 Google Vision 将 PDF 提取到文本/表格中。我的 PDF 包含一个我要提取的表格(BlockType
= 表格)。
我不确定如何在 C# 中做到这一点。
我安装了Google.Cloud.Vision.API
NuGet 并尝试使用该DetectTextDocument
方法,但它似乎只接收图像。
var client = new ImageAnnotatorClientBuilder
{
CredentialsPath = @"myjsonfile.json"
}.Build();
Image image = Image.FromUri("https://storage.cloud.google.com/pathtomyfile.pdf");
TextAnnotation response = client.DetectDocumentText(image); // Getting error for a bad image.
然后我尝试查找任何文件方法并找到了BatchAnnotateFilesAsync
但我不确定如何构建BatchAnnotateFilesRequest
它需要的对象并且在C#
.
谁能帮我弄清楚如何将PDF文档提取为表格块类型的文本?
提前致谢。
解决方案
推荐阅读
- react-native - 检查未定义的道具
- java - 如何从合同状态中获取 stateAndRef?
- r - CRAN 拒绝基于“描述包中方法的参考”
- sql-server - 使用 sqlcmd 将 SQL 记录导出到 .csv
- machine-learning - BERT 模型在语法正确性和语义连贯性方面的评估措施
- cordova - 使用 Cordova 中的地址打开设备的地图应用程序
- reactjs - 反应国际删除错误日志并列出键
- sql - 今天安装 Microsoft .NET Framework 4.8 版本 4.8.03761 后,Access 数据库 vba UPDATE SQL 命令停止工作
- vim - VIM Colemak yank 重新映射问题
- java - Android Wear OS 关闭 Wifi