https://github.com/hansemannn/titanium-pspdfkit-ios
A refactored version of the (awesome) PSPDFKit iOS module for Titanium using pure Swift.
https://github.com/hansemannn/titanium-pspdfkit-ios
appcelerator ios javascript native pspdfkit titanium
Last synced: 23 days ago
JSON representation
A refactored version of the (awesome) PSPDFKit iOS module for Titanium using pure Swift.
- Host: GitHub
- URL: https://github.com/hansemannn/titanium-pspdfkit-ios
- Owner: hansemannn
- License: mit
- Created: 2018-08-05T14:07:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-21T10:29:24.000Z (almost 8 years ago)
- Last Synced: 2025-01-27T07:11:37.765Z (over 1 year ago)
- Topics: appcelerator, ios, javascript, native, pspdfkit, titanium
- Language: Swift
- Size: 1.06 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PSPDFKit for Titanium iOS
The repository contains the WiP of the revamped PSPDFKit module for Titanium. It represents an example of
using the new Swift-based module-architecture in Titanium by showing common usages and best practices for
modern Titanium module development.
> ⚠️ The module is currently WiP and should **not** be used in production, yet!
## Getting Started
### Carthage (Recommended)
1. Change the API key inside the `Cartfile` to match your PSPDFKit API key
2. Run `carthage update` to update the project dependencies
3. Run `carthage build --platform iOS` to build the project dependencies
4. Copy the resulting frameworks `PSPDFKit.framework` and `PSPDFKitUI.framework` to `platform`
5. Done!
### Manual
1. Download your copy from [here](https://pspdfkit.com/guides/ios/current/getting-started/integrating-pspdfkit/)
2. Unzip and copy the resulting frameworks `PSPDFKit.framework` and `PSPDFKitUI.framework` to `platform`
3. Done!
## Example
```js
import PSPDFKit from 'ti.pspdfkit';
// Set your license key
PSPDFKit.licenseKey = 'YOUR_LICENSE_KEY';
const win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
const btn = Ti.UI.createButton({
title: 'Open PDF Document'
});
const document = Ti.Filesystem.getFile('PSPSDKit.pdf');
btn.addEventListener('click', () => {
// Show our PDF document
PSPDFKit.present(document, {
documentLabelEnabled: true
});
});
win.add(btn);
win.open();
```
## Build the Module
```sh
appc run -p ios --build-only
```
## Author
Hans Knöchel
## License
MIT