DocumentView Options

From Lianjapedia
Jump to: navigation, search

See Also

ArticleView Options, Attachments Options, DocumentView Section Attributes

Overview

DocumentView Section in Lianja Web Client



DocumentView Sections are used to view pdf documents.

The DocumentView Section includes tools for printing, downloading, searching, zooming and navigating the document displayed without having to install any plugins.

Lianja DocumentView Demo

example_docview App



The 'Lianja DocumentView Demo' (example_docview) is included in the Lianja App Builder distribution to demonstrate the use of a DocumentView Section.


example_docview App


DocumentView Section options

DocumentView Section options


The following DocumentView Section section-specific options are available:

File

The File Attribute defines the pdf file to be displayed in the Section. In the example_docview App, the File Attribute is empty, because it uses the Desktop DocumentView Section's default pdf document, 'compressed.tracemonkey-pldi-09.pdf'. This pdf file is included in the example_docview App's directory. The Web Client DocumentView Section does not have a default pdf document, so the File Attribute should have a value set before deploying this App to the Web Client.

compressed.tracemonkey-pldi-09.pdf

The Web Client DocumentView Section can also display documents from the Library (\lianja\cloudserver\tenants\public\wwwroot\library):

library:/compressed.tracemonkey-pldi-09.pdf

or

lib:/compressed.tracemonkey-pldi-09.pdf

The File Attribute can contain '{}' macros, e.g.

{documents.document}
File Attribute with macro



Here we have a 'documents' table with a field called 'document' containing the name of a pdf file located in the App's directory.


File Attribute with macro, Web Client



Navigating through the 'documents' table loads the pdf named in 'documents.document' into the DocumentView Section.


The File Attribute is not directly accessible from scripting. DocumentView Sections are based on the 'documentview.rsp' Lianja Server Page script located in the Library. The 'documentview.rsp' script takes one parameter, the name of the pdf file to be displayed. To set the file from scripting, the Section url property should be used: reload library:/documentview.rsp and pass it the name of your file, then refresh the Section. e.g.

Lianja.get("page1.section1").url = "library:/documentview.rsp?file=compressed.tracemonkey-pldi-09.pdf";
Lianja.get("page1.section1").refresh();

Notes on Client Support

Attribute Notes
File -