DocumentView [examples]


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.


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




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


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

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";