Nativescript PSPDFKit
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
Modify the defaultConfig entry within the app.gradle file found in the app/App_Resources/Android/ folder
defaultConfig {
minSdkVersion 19
;;;/* 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',;
IMPORTANT: Make sure you include xmlns:pspdfkit="nativescript-pspdfkit" on the Page tag
Angular
;;registerElement"TNSPSPDFView",require"nativescript-pspdfkit".TNSPSPDFView;
Webpack Setup worker loader -> link
API
Property | Default | Type | Required | Description |
---|---|---|---|---|
scrollDirection | vertical | string |
|
|
scrubberBar | horizontal | string |
|
|
thumbnailBar | none | boolean |
|
|
spreadFitting | "adaptive" | string |
|
|
thumbnailSize | Defaults to 88x125 on iPad and 53x75 on iPhone | string |
|
|
pageMode | automatic | string |
|
|
minZoom | 1 | number |
|
|
maxZoom | 20 | number |
|
|
searchResultZoom | 2 | number |
|
|
formsEnabled | true | boolean |
|
|
src | null | string |
|
Example Image
IOS | Android |
---|---|