Skip to content
Apache PdfBox for NativeScript.
TypeScript Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
demo
publish
screenshots
src
.gitignore
.travis.yml
LICENSE
README.md
tslint.json

README.md

NativeScript PdfBox android

npm npm Build Status

Apache Pdfbox for NativeScript. This plugin allows you to extract the text from a PDF file.

ALPHA version. Android only (iOS may come in the future, PR are welcome).

Sample Android

The screenshot is based on the sample.pdf included in the demo project.

Based on:

Installation

tns plugin add nativescript-pdfbox

Usage

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);
    });

License

Apache License Version 2.0, January 2004

You can’t perform that action at this time.