Quantcast

Sales:
(215) 821-7004

Document Previews

Use the Document Preview API to enable a few pages of a document to be previewed in the Vuzit document viewer before allowing access to every page of the document. The complete version of the document can be accessed within the Vuzit document viewer or as a downloadable version of the document. The Document Viewer API is part of the Javascript API. This feature is useful if you are selling documents online and want give to prospective buyers a sample of the content.

Example

The following example displays only a subset of the pages in the entire document. This makes it easy to display a simple preview of a document for inspection by a prospective buyer or highlight specific content within a larger document.

Usage

The Javascript API is the primary method to display document previews. The Javascript API uses the Image API to display only the requested pages. Security is maintained by using a modified authentication scheme. Currently this scheme is not documented, but if you contact us we will be happy to provide you with the details.

Javascript API

The Viewer constructor methods are the standard way to specify document previews (e.g. Viewer::fromId(), Viewer::fromUrl(), Viewer::initialize()).

Code:

viewer = vuzit.Viewer.fromId("1jwx", {includedPages: "0-1,4-6,81,83,96-103"});
viewer.display(document.getElementById("vuzit_viewer"), {zoom: 0 });