4.3.4 • Published 6 years ago

nativescript-pspdfkit v4.3.4

Weekly downloads
2
License
Apache-2.0
Repository
-
Last release
6 years ago

Nativescript PSPDFKit

npm npm

NativeScript implementation of PSPDFKit (https://pspdfkit.com/). Currently for iOS only, Android support is coming soon.

Please note that this plugin is not production ready. You will have to fork this project to get your licensed version POD installed correctly (currently).

Installation

npm install nativescript-pspdfkit

Example Implementation

Android

Modify the activity entry within the AndroidManifest.xml file found in the app/App_Resources/Android/ folder

<activity
        android:name="com.github.TeamMaestro.TNSFragmentActivity"
        android:label="@string/title_activity_kimera"
        android:configChanges="keyboardHidden|orientation|screenSize">

        <activity android:name="com.pspdfkit.ui.PdfActivity" android:windowSoftInputMode="adjustNothing" />
        <meta-data android:name="pspdfkit_license_key" android:value="youKey"/>

Modify the defaultConfig entry within the app.gradle file found in the app/App_Resources/Android/ folder

defaultConfig {
    minSdkVersion 19
import {TNSPSPDFKit} from 'nativescript-pspdfkit';
let licenseKey = '';
let pspdfkit = new TNSPSPDFKit(licenseKey);
/*
 TNSPSPDFKitOptions {
  scrollDirection?: 'vertical' | 'horizontal';
  backgroundColor?: string;
  spreadFitting?: 'adaptive' | 'fit' | 'fill';
  thumbnailBar?: 'scrollable' | 'scrubber' | 'none';
  scrubberBar?: 'verticalRight' | 'verticalLeft';
  thumbnailSize?: string;
  pageMode?: 'automatic' | 'single' | 'double';
  minZoom?: number;
  maxZoom?: number;
}

*/
pspdfkit.display('~/example.pdf',{ scrollDirection: 'vertical' });

IMPORTANT: Make sure you include xmlns:pspdfkit="nativescript-pspdfkit" on the Page tag

<pdfView:TNSPSPDFView scrollDirection="horizontal" scrubberBar="verticalRight" thumbnailBar="scrubber" spreadFitting="fill" src="~/example.pdf"/>

Angular

import { TNSPSPDFView } from 'nativescript-pspdfkit';
import { registerElement } from "nativescript-angular/element-registry";
registerElement("TNSPSPDFView", () => require("nativescript-pspdfkit").TNSPSPDFView);
<TNSPSPDFView selectedIndexChange="pageChanged" scrollDirection="horizontal" scrubberBar="verticalRight" thumbnailBar="scrubber" spreadFitting="fill" src="~/example.pdf"></TNSPSPDFView>

Webpack Setup worker loader -> link

API

PropertyDefaultTypeRequiredDescription
scrollDirectionverticalstring-
scrubberBarhorizontalstring-
thumbnailBarnoneboolean-
spreadFitting"adaptive"string-
thumbnailSizeDefaults to 88x125 on iPad and 53x75 on iPhonestring-
pageModeautomaticstring-
minZoom1number-
maxZoom20number-
searchResultZoom2number-
formsEnabledtrueboolean-
srcnullstring- x

Example Image

IOSAndroid
IOSAndroid
4.3.4

6 years ago

4.3.3

6 years ago

4.3.2

6 years ago

4.3.1

6 years ago

4.3.0

6 years ago

4.2.0

6 years ago

4.1.0

6 years ago

3.3.0

6 years ago

3.2.2

6 years ago

3.2.1

6 years ago

3.2.0

6 years ago

3.1.1

6 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.5.0

7 years ago

2.4.0

7 years ago

2.3.8

7 years ago

2.3.7

7 years ago

2.3.6

7 years ago

2.3.5

7 years ago

2.3.4

7 years ago

2.3.3

7 years ago

2.3.2

7 years ago

2.3.1

7 years ago

2.3.0

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.0.0

8 years ago