Group |
Function |
Description |
Status |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
int openFile ( String url ); |
Open an ePUB/PDF
file and tell Adobe RMSDK Engine to prepare resource. Parameters:
Return:
Example: String
bookUrl = "/sdcard/mybook.pdf"; int status = openFile(bookUrl); if (status == 0) { Log.d(TAG, "Open(" + bookUrl + ") success!"); }
else { Log.d(TAG, "Open(" + bookUrl + ") fail, status=" + status); } |
Ready |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
int closeFile(); |
Close an ePUB/PDF
file and tell Adobe Engine to release resource Return:
Example: int status = closeFile(); if (status == 0) { Log.d(TAG, "Close
file success!"); }
else { Log.d(TAG, "Close
file fail, status=" + status); } |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
void cancelProcessing ( ); |
Cancel long time processing. Example: canelProcessing(); |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
System |
void setViewportSize ( int w, int h ); |
Assigns the size of the viewport in the
document's coordinate system. Parameters:
Example: int width = 600; int height = 800; setViewportSize(width, height); |
Ready |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
void setFontSize ( int size ); |
Set font size. Parameters:
Example: int size = 1; setFontSize(size); |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int setPDFPassword( String pwd ); |
Set password for PDF file Parameters:
Return:
Example: String
bookUrl = "/sdcard/mybook.pdf"; String
bookPassword = "1234"; int status = openFile(bookUrl); // -410 means need to set password before open PDF
file. if (status == -410) { // Set PDF password. status = setPDFPassword(bookPassword); if (status == 0) { // Open the file again. status = openFile(bookUrl); } } |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int setPassHash ( String
username, String pwd ); |
Set Passhash. Parameters:
Returns:
|
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int setUserActivation ( String userID, String password ); |
Activate device Parameters:
Returns:
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int setDeviceDeactivation(); |
De-activate device Returns:
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int setHash ( String
hash ); |
Set hash. |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int setScreenlandscape ( boolean scape ); |
Set if the screen is in
Landscape mode. Example: int width = 600; int height = 800; if (width >
height) { setScreenlandscape(true); }
else { setScreenlandscape(false); } |
Testing |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
void setBackground ( boolean
background ); |
Set background mode: false -> day true -> night Example: setBackground(true); |
Todo |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Highlight |
void getCurrentHighlightedPage ( int[] pagebuf ); |
Get “PageBuffer”
for current highlighted page. Example: int width = 600; int height = 800; int[] page_buffer = new int[width * height]; getCurrentHighlightedPage(page_buffer); |
Ready |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
boolean setHighlightbyloc ( String
start, String
end, int z ); |
Highlight the content between two
locations. Parameters:
Returns: A Boolean indicate
whether the operation is succeed or not. |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
boolean delHighlight ( String
start, String
end, int z ); |
Remove the highlighting specified by two
locations and type. Parameters:
Returns: A Boolean indicate whether the operation is succeed or not. |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
void delAllHighlight(); |
Remove all highlighting both selection and
annotation. Parameters: none |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Link |
int getLinkCount(); |
Returns the number of links on the current
screen. Note: This API is needed for compatibility
reasons and should be avoided. The better way to handle links is by
sending events to the renderer. Example: int linkCount = getLinkCount(); |
Ready |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
void highlightLink( int linkIndex ); |
Highlight the link by Index. Parameters:
Example: int linkIndex = 10; int linkCount = getLinkCount(); if (linkIndex < linkCount) { highlightLink(linkIndex); } |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
void selectLink( int linkIndex ); |
Select the link by Index. Parameters:
Example: int linkIndex = 10; int linkCount = getLinkCount(); if (linkIndex < linkCount) { selectLink(linkIndex); } |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
String linkTest ( double x, double y, String[] urlStrings ); |
Check if coordinate (x, y) contains a link. Parameters:
Returns: 0 : There in NO link in (x, y) 1 : There is a EXTERNAL link in (x, y)
and the URL will be return via urlStrings, please
aware of that urlStrings should at least contain one
element and can’t be a null pointer. 2 : There is a INTERNAL link in (x, y)
and the internal cursor has been change to target location, the screen is
need to be refreshed (call getCurrentPage() ). Example: String[]
urlStrings = new String[1]; int result = linkTest(x, y, urlStrings); if (result == 1) { Log.d(TAG, "External
link, url=" + urlStrings[0]); }
else if (result == 2) { Log.d(TAG, "Internal
link"); } |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Search |
boolean goText ( String netext ); |
Query the given text and highlight it with
selection type highlight. If there is not text found , returns false.
Parameters:
Returns: True / False Example: String
text = "adobe"; boolean found = false; if (found) { Log.d(TAG, "The text
is found!"); }
else { Log.d(TAG, "The text
is not found!"); } |
Ready |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
boolean findNextText ( String
text ); |
Query the given text in forward order, starts
from position of last found and highlight it with selection
type. If there is not text found , returns false.
Parameters:
Returns: True / False |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
boolean findPreviousText ( String
text ); |
Query the given text in backward order, starts from position of last
found and highlight it with selection type. If there is not text found , returns false. Parameters:
Returns:
True
/ False |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
boolean resetFindText(); |
Cancel find processing and
reset the “Find Location”[2]. |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int compare ( String
bookmark1, String
bookmark2 ); |
Compare
two location by their position in the document. Not
all locations can be compared precisely. If value returned in precise variable is false, and returned value
is zero, locations point approximately to the same position in the
document (e.g. the same page). Comparison
operation can be fairly expensive. Only Locations that originated from the
same document can be compared. Parameters:
Returns: 0 - locations point to the same position; -1
- this comes first, 1 - other comes first Example: String
someLocation; String
currentLocation = getCurrentLocation(); int result = compare(someLocation, currentLocation); if (result == 1) { Log.d(TAG, "someLocation first!"); }
else if (result == -1) { Log.d(TAG, "currentLocation first!"); }
else { Log.d(TAG, "The
same!"); } |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
String hitTest ( double x1, double y1 ); |
Retrieve document location which best
corresponds to x and y coordinates is stored there. Parameters:
Returns: Location (bookmark) in String format. Example: String
hitLocation = hitTest (x,
y); |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
String findNextMark(); |
Find next mark |
Todo |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
String findPreviousMark(); |
Find previous mark |
Todo |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
SearchResult[] getSearchResult ( String
Text, int max, int cont ); |
Search word(s) from the beginning of the document, and return a list of SearchResult array which contains public class SearchResult {
public String text;
public String start_pos;
public String end_pos; } If there is not text found , returns null. Parameters:
Returns: Null or an array
of SearchResult object. Note: Parameter
‘cont’ will be influence by function calls such as findNextText,
findPreviousText, etc. |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Book |
String getMetaData
( String name ); |
Extracts named metadata item
from the document. To query metadata, Dublin
Core names should be used, e.g.: "DC.title"
- title of the document "DC.creator"
- who created the content (author) "DC.date"
- when the document was created Note the casing of the prefix
and element names. These are taken from http://dublincore.org/documents/dc-html/ and
DC prefix is considered to be predefined (as OPF and PDF lack ability to
define it). Note on EPUB metadata:
Metadata recorded using opf:meta element can be queried
simply using name attribute value. Custom-namespace metadata elements are not
supported by this API. Some metadata items can have
additional attributes such as language (xml:lang)
or type (xsi:type). These are returned
through attrs parameter
in whitespace-separated sequence of attribute/value
pairs (in the form attr=value). Parameters:
Returns: UTF8-encoded value of metadata, NULL if it does not
exist Example: String
title = getMetaData("DC.title"), String
creator = getMetaData("DC.creator"), String
identifier = getMetaData("DC.identifier"); String
date = getMetaData("DC.date"); |
Ready |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
Chapter |
int getNumChapters (); |
Get total number of chapters
available in current viewed document. Returns: Number of chapters available in current document. Example: int numberOfChapter = getNumChapters(); |
Ready |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
String[] getChapterList
(); |
Query the document for a list of chapters available. Returns: A String array represents
a list of chapters. Example: String[]
chapterList = getChapterList(); |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int goToChapterIndex ( int chapterIndex ); |
Because the total number of
chapter is fixed according to TOCs, so the user can
utilize this function to jump to any chapter by index. Parameters:
Returns:
Example: int chapterIndex = 10; int numberOfChapters = getNumChapters(); if (chapterIndex < numberOfChapters)
{ goToChapterIndex(chapterIndex); } |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int goToChapter ( String chapter ); |
Jump to the specified chapter
by name. Parameters:
Returns:
Example: int chapterIndex = 10; int numberOfChapters = getNumChapters(); String[]
chapterList = getChapterList(); if (chapterIndex < numberOfChapters)
{ goToChapter (chapterList[chapterIndex]); } |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
double getChapterPagePositionFromIndex ( int idx ); |
Because the total number of
chapter is fixed according to TOCs, so the user can
utilize this function to get any position of chapter by index.[1] Example: int chapterIndex = 10; int numberOfChapters = getNumChapters(); double pagePosition; if (chapterIndex < numberOfChapters)
{ pagePosition = getChapterPagePositionFromIndex
( chapterIndex ); } |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
double getChapterPagePosition ( String
title ); |
Get the chapter position by
name. Example: int chapterIndex = 10; int numberOfChapters = getNumChapters(); String[]
chapterList = getChapterList(); double pagePosition; if (chapterIndex < numberOfChapters)
{ pagePosition = getChapterPagePosition
( chapterList[chapterIndex] ); } |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int getCurrentChapterIndex
(); |
Get the chapter index by page
current location. Be aware of that if there are more than one chapter locate
in the same page, for example if Chapter 1(index=1) and Chapter 1.1(index=2)
both locate in page 10, then the function may return the index of chapter
1(index=1) or chapter 1.1(index=2). In order to find the next chapter, the
user have to use getChaperPagePositionFromIndex()
to get the current chapter position and keep finding the next chapter
position until different position is found. Example: int currentIndex = getCurrentChapterIndex(); |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Page |
int getNumPages(); |
Get the total number of pages Example: int numberOfPages = getNumPages(); |
Ready |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
int getPage ( int pageno, int[] mypage_buf ); |
Get specified “PageBuffer” by page number. Returns:
Example: int width = 600; int height = 800; int pageNo = 100; int[] pageBuffer = new int[width *
height]; getPage(pageNo, pageBuffer); |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
boolean getNextPage(); |
Return true if the book has
next page, return false elsewise. |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
boolean getPreviousPage(); |
Return true if the book has
previous page, return false elsewise. |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int getCurrentPage ( int[] pagebuf ); |
Get “PageBuffer”
of current page. Returns:
Example: int width = 600; int height = 800; int[] pageBuffer = new int[width *
height]; getCurrentPage(pageBuffer); |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
String getCurrentLocation(); |
Get the current
location(bookmark). Example: String
currentLocation = getCurrentLocation(); |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int goToLocation ( String
bookmark ); |
Jump to the specified
location(bookmark). Parameters:
Returns:
Example: String
someLocation; goToLocation(someLocation); |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
int goToPosition
( double position ); |
Jump to the specified
location(position). Parameters:
Returns:
Example: double pagePosition = 50.0 goToPosition(pagePosition); |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
double getPagePosition ( String
bookmark ); |
Convert the
location(bookmark) to position. Example: String
someLocation; double pagePosition = getPagePosition(someLocation); |
Ready |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
String getSummaryByLocation ( String bookmark ); |
Retrieve document context based on
given bookmark input Parameters:
Returns: String represents context. |
Ready |
Group |
Description |
Name |
Value |
Description |
Message |
The operation is success, no
error happened. Non-zero value is used to carry more information about the
current state. |
STATE_MESSAGE_OK |
0 |
No error. |
STATE_MESSAGE_HAS_EXTERNAL_LINK |
1 |
The target location contains
external location. |
||
STATE_MESSAGE_HAS_INTERNAL_LINK |
2 |
The target location contains
internal location. |
||
STATE_MESSAGE_PDF_T3_RENDERING_EVENT |
3 |
Error event during document
rendering |
||
Unknown |
An error is happened, but not
classified. |
STATE_FATAL_UNKNOWN |
-1 |
Un-cached error message, and the
severity level is FATAL. |
STATE_ERROR_UNKNOWN |
-2 |
Un-cached error message, and
the severity level is ERROR. |
||
STATE_WARN_UNKNOWN |
-3 |
Un-cached error message, and
the severity level is WARNING. |
||
System |
The error is related to system
or engine. |
STATE_ERROR_DOC_NOT_INIT |
-100 |
Document object is not
initialized yet, probably openFile is missing or
doing any operation before successfully calling openFile() |
STATE_FATAL_SYS_NOT_INIT |
-101 |
System not initialized. |
||
STATE_FATAL_SYS_INIT_FAIL |
-102 |
System initialize fail. |
||
STATE_FATAL_PREVIOUS_FILE_NOT_CLOSED |
-103 |
Previous file is not closed. |
||
STATE_FATAL_FILE_NOT_EXIST |
-110 |
This file cannot be found. |
||
STATE_ERROR_NULL_BOOKMARK |
-111 |
Invalid bookmark. |
||
STATE_ERROR_NEGATIVE_POSITION |
-112 |
Invalid position. |
||
STATE_ERROR_NULL_PASSHASH |
-113 |
Invalid Pass Hash. |
||
STATE_WARN_DEVICE_NOT_ACTIVATE |
-120 |
The device not activated
before. |
||
STATE_WARN_DEVICE_ALREADY_ACTIVATED |
-121 |
The device already activated. |
||
STATE_ERROR_STREAM_CURL |
-130 |
Error in URL operation |
||
STATE_ERROR_PKG_RESOURCE_TOO_LONG |
-140 |
The PDF page size is too
large. |
||
STATE_ERROR_PKG_COMPRESSED_SIZE_TOO_BIG |
-150 |
The EPUB page size is too
large. |
||
STATE_ERROR_PKG_ARTIFICIAL_PAGE_BREAKS |
-160 |
The EPUB page size is too
large. |
||
STATE_WARN_PKG_BAD_REF |
-170 |
The reference of package is
wrong. |
||
PDF |
An error happened when
rendering PDF file. |
STATE_FATAL_PDF_T3_DOC_EXCEPTION |
-200 |
Reading PDF file error. The
file is broken. |
STATE_ERROR_PDF_T3_DOC_EXCEPTION |
-210 |
Reading PDF file error. |
||
EPUEB |
An error happened when
rendering EPUB file. |
STATE_FATAL_PKG_XML_PARSE_ERROR |
-300 |
Reading EPUB file error. The file
is broken. |
STATE_ERROR_PKG_XML_PARSE_ERROR |
-310 |
Reading EPUB file error. |
||
DRM |
DRM-related errors |
STATE_ERROR_PASSHASH_NOT_FOUND |
-400 |
The EPUB file is pass-hash
protected, need correct pass hash code to open it |
STATE_ERROR_PASSHASH_NO_URL |
-405 |
Unable to get operator URL. |
||
STATE_ERROR_PASSHASH_OP_FAIL |
-406 |
Pass Hash error. |
||
STATE_ERROR_PDF_T3_NEED_PASSWORD |
-410 |
The PDF file is password
protected, need correct password to open it |
||
STATE_ERROR_PDF_EMPTY_PASSWORD |
-420 |
The empty password is not
allowed. |
||
STATE_ERROR_AUTHENTICATION_FAIL |
-430 |
The given authentication
information (user name, password, tc) failed to
authenticate the target document (PDF/ePUB) |
||
STATE_ERROR_USER_NOT_ACTIVATED |
-440 |
Device need to be activated
before using. |
||
STATE_ERROR_NO_VALID_LICENSE |
-450 |
Activation license is not
valid |
||
STATE_ERROR_CORE_EXPIRED |
-451 |
Load book has been expired,
and should not be open for display |
||
STATE_ERROR_CORE_LOAN_NOT_ON_RECORD |
-452 |
The loan book had been return
by ADE, and no longer be available on device. |
[1]
There are two kind of structure to represent LOCATION, the first one is BOOKMARK
which is represented by a string value, the second one is POSITION which is
represent by a double.
[2] When the SEARCH related function
is call the Adobe Engine will keep the latest “Find Location” in memory, next
time when the SEARCH related function is called again this location will be
used as a start location.
*PLEASE don’t have ‘android:debuggable=”true’’
attribute in your <application> element, this will causes some RMSDK
operations fail. This issue should be fixed soon.
*NOTE: the default resolution of screen has been change to 600*800, please
make sure there is enough page buffer while calling API.