Skip to content

Commit 9737fc3

Browse files
[README.md] HOWTO supply password for decryption
1 parent 47c09d9 commit 9737fc3

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,19 @@ Library is interfaced through Java.
3636
import com.viliussutkus89.android.pdf2htmlex.pdf2htmlEX;
3737
...
3838
java.io.File inputPdf = new java.io.File(getFilesDir(), "my.pdf");
39-
pdf2htmlEX converter = new pdf2htmlEX(getApplicationContext());
40-
java.io.File outputHTML = converter.convert(inputPdf);
39+
java.io.File outputHTML = new pdf2htmlEX(getApplicationContext()).setInputPDF(inputPdf).convert();
40+
```
41+
42+
Encrypted PDF documents need a password to be decrypted.
43+
44+
Either owner (admin):
45+
```Java
46+
java.io.File outputHTML = new pdf2htmlEX(getApplicationContext()).setInputPDF(inputPdf).setOwnerPassword("owner-password").convert();
47+
```
48+
or user password can be used:
49+
```Java
50+
51+
java.io.File outputHTML = new pdf2htmlEX(getApplicationContext()).setInputPDF(inputPdf).setUserPassword("user-password").convert();
4152
```
4253

4354
Library needs Android Context to obtain path to cache directory and asset files, which are supplied in .aar.

0 commit comments

Comments
 (0)