Below you can find a list of the RadaeePDF-Cordova Plugin's Javascript exposed methods:
RadaeePDFPlugin.activateLicense(
{
licenseType: 2, //0: standard license, 1: professional license, 2: premium license.
company: "radaee", //company name you entered during license activation, for iOS "Radaee"
email: "This email address is being protected from spambots. You need JavaScript enabled to view it.", //the email you entered during license activation
key: "LNJFDN-C89QFX-9ZOU9E-OQ31K2-FADG6Z-XEBCAO" //your license activation key, for iOS "89WG9I-HCL62K-H3CRUZ-WAJQ9H-FADG6Z-XEBCAO"
},
function(message) {
console.log("Success: " + message);
},
function(err) {
console.log("Failure: " + err);
});
RadaeePDFPlugin.open(
{
url: "file:///mnt/sdcard/Download/Test.pdf", //remote -> "http://www.radaeepdf.com/documentation/MRBrochoure.pdf"
password: "",
readOnlyMode: false, //optional, if true, the document will be opened in read-only mode
automaticSave: false, //optional, if true, the modifications will be saved automatically, else a requester to save will be shown
gotoPage: 2 //optional, if greater than 0, the reader will render directly the passed page (0-index: from 0 to Document.GetPageCount - 1)
},
function(message) {
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.openFromAssets(
{
url: "Test.PDF",
password: ""
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.getPageNumber(
{
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.getJSONFormFields(
{
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.getJSONFormFieldsAtPage(
{
page: 1
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.setFormFieldWithJSON(
{
json: "{\"Pages\": [{\"Page\": 0,\"Annots\": [{\"Index\": 0,\"Name\": \"\",\"Type\": 20,\"FieldName\": \"Fecha\",\"FieldNameWithNO\": \"Fecha\",\"FieldFullName\": \"Fecha\",\"FieldFullName2\": \"Fecha\",\"FieldFlag\": 0,\"FieldFormat\": \"AFDate_FormatEx(\\\"dd\\/mm\\/yyyy\\\");\",\"FieldType\": 2,\"CheckStatus\": -1,\"ComboItemSel\": -1,\"ComboItemCount\": -1,\"ListSels\": \"\",\"ListItemCount\": -1,\"EditText\": \"1\",\"EditType\": 1,\"EditTextFormat\": \"AFDate_FormatEx(\\\"dd\\/mm\\/yyyy\\\");\",\"SignStatus\": -1}]}]}"
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.setReaderViewMode(
{
mode: 3 //0:vertical 3:single 4:dual 6:Dual with cover(1st page single)
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.setReaderBGColor(
{
color: 0xffff0000
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.setTitleBGColor(
{
color: 0xffff0000
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.setIconsBGColor(
{
color: 0xffff0000
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.setThumbHeight(
{
height: 150
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.setThumbnailBGColor(
{
color: 0xffff0000
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.setFirstPageCover(
{
cover: true
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.getPageCount(
{
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.extractTextFromPage(
{
page: 1
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.encryptDocAs(
{
dst: "/sdcard/test_enc.pdf", //path to save, same as path parameter of SaveAs.
upswd: "user", //user password, can be null (is the public password (shared with authorized users). It's sufficient to open the file with applied permission mask set).
opswd: "owner", //owner password, can be null (is the password that allow opening the file without any restriction from the permission mask).
perm: 3, //permission to set, same as GetPermission() method.
bit 1-2 reserved
bit 3(0x4) print
bit 4(0x8) modify
bit 5(0x10) extract text or image
others: see PDF reference
method: 3, //set 3 means using AES 256bits encrypt(Acrobat X), V=5 and R = 6 mode, others AES with V=4 and R=4 mode.
id: "123456789abcdefghijklmnopqrstuvw" //must be 32 bytes for file ID. it is divided to 2 array in native library, as each 16 bytes (something like the encryption seed or salt in some other encryption scheme. That id is a reserved code that make password stronger).
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.addToBookmarks(
{
pdfPath: "/mnt/sdcard/Download/Test.pdf", //path to pdf
page: 1, //0-based page index (from 0 to Document.GetPageCount - 1)
label: "label" //optional label for the bookmark (in iOS label is not supported)
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.removeBookmark(
{
page: 1, //0-based page index (from 0 to Document.GetPageCount - 1)
pdfPath: "/mnt/sdcard/Download/Test.pdf" //path to pdf
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.getBookmark(
{
pdfPath: "/mnt/sdcard/Download/Test.pdf" //path to pdf
},
function(message){
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);
});
RadaeePDFPlugin.renderAnnotToFile(
{
page: 4, //page index of the page containing the annotation 0-index (from 0 to Document.GetPageCount - 1)
annotIndex: 3, //the annotation index (can be obtained from didTapOnAnnotationOfType callback)
renderPath: "/mnt/sdcard/signature.png", //the directory path in which the annotation will be saved (in case of sdcard make sure the WRITE_EXTERNAL_STORAGE permission is granted)
width: 0, //the desired width of the result bitmap, 0 in case of using original width
height: 0 //the desired height of the result bitmap, 0 in case of using original height
},
function(message) {
console.log("Success: " + message);
},
function(err){
console.log("Failure: " + err);}
);
function registerCallbacks()
{
RadaeePDFPlugin.willShowReaderCallback(willShowReader);
RadaeePDFPlugin.didShowReaderCallback(didShowReader);
RadaeePDFPlugin.willCloseReaderCallback(willCloseReader);
RadaeePDFPlugin.didCloseReaderCallback(didCloseReader);
RadaeePDFPlugin.didChangePageCallback(function(message){didChangePage(message);});
RadaeePDFPlugin.didSearchTermCallback(function(message){didSearchTerm(message);});
RadaeePDFPlugin.didTapOnPageCallback(function(message){didTapOnPage(message);});
RadaeePDFPlugin.didTapOnAnnotationOfTypeCallback(function(message){didTapOnAnnotationOfType(message);});
RadaeePDFPlugin.didDoubleTapOnPageCallback(function(message){didDoubleTapOnPage(message);});
RadaeePDFPlugin.didLongPressOnPageCallback(function(message){didLongPressOnPage(message);});
}
function willShowReader()
{
console.log("--- Callback: willShowReader");
}
function didShowReader()
{
console.log("--- Callback: didShowReader");
}
function willCloseReader()
{
console.log("--- Callback: willCloseReader");
}
function didCloseReader()
{
console.log("--- Callback: didCloseReader");
}
function didChangePage(page)
{
console.log("--- Callback: didChangePage: " + page);
}
function didSearchTerm(term)
{
console.log("--- Callback: didSearchTerm: " + term);
}
function didTapOnPage(page)
{
console.log("--- Callback: didTapOnPage: " + page);
}
function didTapOnAnnotationOfType(type)
{
console.log("--- Callback: didTapOnAnnotationOfType: " + type);
}
function didDoubleTapOnPage(page)
{
console.log("--- Callback: didDoubleTapOnPage: " + page);
}
function didLongPressOnPage(page)
{
console.log("--- Callback: didLongPressOnPage: " + page);
}
RadaeePDF SDK for Cordova
Created : 2017-03-02 09:22:49, Last Modified : 2022-03-21 17:52:37