How To Use kiwappPDF.js

kiwappPDF.js is a kiwapp.js based labrary which provides you simple methods to read pdf using native on Android and iOS.

It can not work without Kiwapp.js loaded in your application. You have to initialize kiwapp before using the kiwappPDF methods.

Initialize Reader

Once Kiwapp is initialized, you can create a Reader bridge.


var reader = new KWReader();


Reader Methods

All the Reader methods are bridges calling native.



Read a document

Once your Reader is ready, you can read documents.



The method "open" of your Reader takes one argument.
This is the reader config :



Creating the configuration. Here the Reader will mask all the webview surface.

var config = {
    origin_x : 0,
    origin_y : 0,
    width    : window.innerWidth,
    height   : window.innerHeight,

If true there is no navigation bar

    navigation_bar_is_hidden : false,

If true an animation will open the file

    modal_launch_with_animation : true,

If true the document can't be sent by e-mail

    private_document: false,

The relative path to your document

    file_path : "../pdf/test.pdf"
};


Reading the document :

reader.open(config);


Close a document (this part only concerns iOS)

reader.close();