Download the PDF version of this guide.
How to include RadaeePDF SDK in your project
Before you can use most APIs from Radaee Core Lib, you have to activate it with your license. To do so, call the following method before everything starts.
import com.radaee.pdf.Global;
......
Global.Init([ApplicationContext], [License_Type], “[Company_Name]”, “[Mail]”, “[Serial]”);
In any layout resource file which you want to display the PDF file content.
Prepare a view for displaying the PDF document content.
Add a “com.radaee.reader.PDFLayoutView” element to wherever you want to display the document content. As following:
<com.radaee.reader.PDFLayoutView
android:id="@+id/[element_id]"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.radaee.reader.PDFLayoutView>
In Activity/Fragment classes which uses that layout file. First you should import following packages:
import com.radaee.pdf.Document;
import com.radaee.reader.PDFLayoutView;
Create document instance:
Document document = new Document();
Open document:
int ret = document.Open(“[Document_Path]”,”[Document_Password]”)
ProcessOpenResult(ret);
* [Document_Password]: set to “” if the document is not encrypted.
Process document open result:
private void ProcessOpenResult(int ret) {
switch( ret ) {
case -1:
//Failed: need input password
break;
case -2:
//Failed: unknown encryption
break;
case -3:
//Failed: damaged or invalid format
break;
case -10:
//Failed: access denied or invalid file path
break;
case 0:
//succeeded, move on
break;
default:
//Failed: unknown error
break;
}
}
Get PDFLayoutView instance to display the document content:
PDFLayoutView view = findViewById(R.id.[your_PDFLayoutView_Element_ID]);
view.PDFOpen(document, null);
RadaeePDF SDK for Android
Create Cordova project with RadaeePDF-Cordova Plugin and RadaeePDF PDF reader
Created : 2021-04-13 17:17:20, Last Modified : 2021-04-13 18:20:44