forked from wonday/react-native-pdf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PdfManager.js
31 lines (23 loc) · 744 Bytes
/
PdfManager.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* Copyright (c) 2017-present, Wonday (@wonday.org)
* All rights reserved.
*
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const invariant = require('fbjs/lib/invariant');
const PdfManagerNative = require('react-native').NativeModules.PdfManager;
export default class PdfManager {
static loadFile(path: string,
password?: string,): Promise<string> {
invariant(
typeof path === 'string',
'path must be a valid string.',
);
if (password === undefined) {
password = "";
}
return PdfManagerNative.loadFile(path, password);
}
}