API Client/Server
Table of Contents
Javascript frontend and backends communicates using a ReST+JSON API.
That's why backends are interchangeables.
You can even write your own. The only thing you have to is to respect this API.
The Dare-Dare API is made of 3 functions: open, read, close. I'll further detail own each works
Opening the document
Must return the following informations (JSON formatted):
- docid: a unique document-session identifiant
- pagenum: number of page of the document
- width: original width of document pages
- height: original height of document pages
Example:
{"docid": "d94eb069466e496e7e237dd16445f401", "numpages": 30, "width": 1754, "height": 1240}
Reading a page
Return the required page as a png image. You must set the following headers with the image:
Content-Type : image/png Content-Disposition: inline; filename="unique-name.png"
Closing the document
