node.js - 从 npm 使用 tabula-js 时如何修复错误?
问题描述
您好,我正在尝试使用 npm tabula-js 从 pdf 中提取数据,当我运行此示例代码时,出现下一个错误
null Error: Exception in thread "main" java.lang.IllegalArgumentException: Comparison method violates its general contract!
at consumer (C:\Users\EQUIPO\Desktop\extract-data-pdf-pancho\node_modules\highland-process\lib\process.js:56:14)
at Stream.s._send (C:\Users\EQUIPO\Desktop\extract-data-pdf-pancho\node_modules\highland\lib\index.js:1560:9)
at Stream.write (C:\Users\EQUIPO\Desktop\extract-data-pdf-pancho\node_modules\highland\lib\index.js:1661:18)
at Stream._send (C:\Users\EQUIPO\Desktop\extract-data-pdf-pancho\node_modules\highland\lib\index.js:984:26)
at Stream.write (C:\Users\EQUIPO\Desktop\extract-data-pdf-pancho\node_modules\highland\lib\index.js:1661:18)
at Socket.ondata (internal/streams/readable.js:719:22)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readablethi.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at Socket.Readable.push (internal/streams/readable.js:223:10)
这是我的代码
const tabula = require('tabula-js');
const t = tabula('testdoc1.pdf');
t.extractCsv((err, data) => console.log(data,err));
解决方案
推荐阅读
- git - Git - 添加所有远程跟踪的本地文件
- nginx - Kubernetes:使用 Let's Encrypt 公开 NGINX Ingress
- c - 使用 openssl C API 构建 ASN1 集
- java - 多态地推导派生类型
- r - 高维数据的相关图看起来不可读
- angular - 在 Ionic 如何将文件数据与请求正文绑定(如何做多部分数据)
- javascript - nav 组件丢失道具。反应路由器错误?
- database - 如何在 Android SQlite 数据库中存储视频的文件路径并访问它们?
- javascript - Quill.js 如何使用带有基本格式的 setText
- java - 使用 Akka HTTP 的 Scala 窗口数据