【问题标题】:Get text from PDF in Google在 Google 中从 PDF 中获取文本
【发布时间】:2016-07-03 04:12:30
【问题描述】:

我有一个保存在 Google 云端硬盘中的 PDF 文档。我可以使用 Google Drive Web UI 搜索来查找文档中的文本。

如何使用 Google Apps 脚本以编程方式提取文档中的部分文本?

【问题讨论】:

标签: pdf google-apps-script google-drive-api drive


【解决方案1】:

this gist 中查看pdfToText()

在 PDF 文件上调用 Google Drive 中内置的 OCR,例如myPDF.pdf,这是你的工作:

function myFunction() {
  var pdfFile = DriveApp.getFilesByName("myPDF.pdf").next();
  var blob = pdfFile.getBlob();

  // Get the text from pdf
  var filetext = pdfToText( blob, {keepTextfile: false} );

  // Now do whatever you want with filetext...
}

【讨论】:

  • 是否可以提取带有突出显示文本的 PDF 注释?
猜你喜欢
  • 2015-06-28
  • 2021-06-26
  • 2012-12-02
  • 1970-01-01
  • 2021-01-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-06-26
相关资源
最近更新 更多