npm i --save nativescript-pdfbox
- 版本:0.2.0
- GitHub:
- NPM: https://npmjs.net.cn/package/nativescript-pdfbox
- 下载量
- 昨天: 0
- 上周: 0
- 上个月: 0
NativeScript PdfBox 
Apache Pdfbox for NativeScript。此插件允许您从 PDF 文件中提取文本。
截图基于演示项目中的 sample.pdf。
基于
- Android PdfBox-Android
此插件目前仅适用于 Android。
安装
tns plugin add nativescript-pdfbox
使用方法
import * as fs from 'tns-core-modules/file-system';
import { PdfBox } from 'nativescript-pdfbox';
const appPath = fs.knownFolders.currentApp().path;
const mySampleFile = appPath + '/sample.pdf';
const removeLineBreaks: boolean = true; // optional, default is false
const pdfbox: PdfBox = new PdfBox();
pdfbox
.getText(mySampleFile, removeLineBreaks)
.then(text => {
this.messageNotRemovedLB = text;
super.notifyPropertyChange('messageNotRemovedLB', text);
});
许可证
Apache 许可证第 2 版,2004 年 1 月