-
Notifications
You must be signed in to change notification settings - Fork 0
Open a Local PDF File with ComPDFKit on Android
CPDFDocument document = new CPDFDocument(context);
// Open document
CPDFDocument.PDFDocumentError error = document.open(pdfUri);
if (error == CPDFDocument.PDFDocumentError.PDFDocumentErrorPassword) {
// The document is encrypted and requires a password to open.
error = document.open(pdfUri, "password");
}
if (error == CPDFDocument.PDFDocumentError.PDFDocumentErrorSuccess) {
// The document is opened successfully and data can be parsed and manipulated.
} else {
//The PDF file is failed to open. You can refer to the API file for specific error messages.
}
//Check if the document has been repaired during the opening process.
if (document.hasRepaired()) {
//The repaired document needs to be saved first and then opened, otherwise any edits or modifications made to the repaired document cannot be saved.
//Perform a save operation
...
}
Contact ComPDFKit.