NativeScript PdfBox
Apache PdfBox for NativeScript.
npm i --save nativescript-pdfbox

NativeScript PdfBox android

Build Status

Apache Pdfbox for NativeScript。此插件允许您从 PDF 文件中提取文本。

Sample Android

截图基于演示项目中的 sample.pdf

基于

此插件目前仅适用于 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 月