PDFlib TET for Android
======================

This package contains a sample app demonstrating how to use PDFlib TET
on Android.

PDFlib TET for Android is a JNI wrapper around the native Android library
"libtet.so". To use TET you have to include the following files in your
application:

    sample_app/libs/armeabi/libtet.so
    sample_app/src/com/pdflib/TET.java
    sample_app/src/com/pdflib/TETException.java

and compile your application using the Android SDK (available at
http://developer.android.com/sdk/index.html)


The directory "sample_app" contains these files plus some additional
source modules which build a complete sample application. This application
is derived from the "extractor" example from the standard TET distribution.

The directories "doc", "java", "data" and "resources" contain the documentation,
more java examples, data resources for the examples and the Cmap resources for
TET.



Building the example sample_app assumes that the Android SDK is installed and
an AVD is set up correctly.

To run the sample it has to be installed on an Android emulator or device.
Also, you must place the input file data/FontReporter.pdf at the expected
location as detailed below.

Here some short instructions:


Building the example from the command line
==========================================
    unpack the zip package
    cd sample_app
    android update project --name extractor_android --target 1 --path $PWD
    ant install

Prepare device
--------------
    adb push ../data/FontReporter.pdf /data/data/com.pdflib/
    # for extracting CJK text you also have to install the CMaps
    # (see also TET manual):
    adb shell mkdir resource
    adb shell mkdir resource/cmap
    adb push ../resource/cmap/83pv-RKSJ-H /data/data/com.pdflib/resource/cmap
    ...

Launch the app on the device/emulator
-------------------------------------
    press the "extractor example" button

Fetching results from the device
-----------------------------
    adb pull /data/data/com.pdflib/FontReporter.txt FontReporter.txt 


Using the example from Eclipse with the ADT Plugin
==================================================
    Import the directory sample_app into an Eclipse workspace with
	"File", "Import", "Existing Projects into Workspace".
    In the DDMS perspective, copy the FontReporter.pdf file and if needed the
	resources to /data/data/com.pdflib/.
    Then right-click on the "extractor_android" project and select
	"Run As", "Android Application" to start the application on an emulator.
    Finally you can fetch the result "FontReporter.txt" with the
	file explorer in the DDMS perspective.


Using the java samples
======================

    If you like to test other examples you may look to the java folder
    for other TET examples and modify the "extractor_android.java" to
    your needs.

See also:

- system-requirements.txt
- http://developer.android.com/guide/index.html
- http://developer.android.com/guide/developing/devices/index.html
- http://developer.android.com/guide/developing/projects/index.html
- http://developer.android.com/guide/developing/building/index.html

- http://developer.android.com/guide/developing/tools/android.html
- http://developer.android.com/guide/developing/tools/emulator.html
- http://developer.android.com/guide/developing/tools/adb.html

