Skip to main content
Version: v4

Opening a document

Opening documents

  • Object: getARenderJS()

    FunctionDescriptionArguments
    loadDocument(url , callback)Note: This is purely a server-side operation, asynchronous at client side.
    Loads a document providing an URL. It will provide an ARender Id back.
    url: the URL to open ;
    callback: the callback function to call when the Id is provided by the server.
    openDocument(id)Opens a document.id: ARender id
    askChangePage(type , index)Changes the current page.type: 'Relative', 'Index' or 'Absolute';
    index: -1 or 1 for 'Relative' or 'Absolute', otherwise the page number
    enablePDFDocumentHyperlinks(boolean)Activate/de-activate the internal hyperlinks of a documentboolean: Load internal hyperlinks of a document if true, unload them otherwise.
    disallowClickOnHyperlinks(boolean)Allow/disallow clicks on a document hyperlink for ARenderboolean: if true, disallow internal hyperlinks of a document, allow them otherwise.
srcipts/example.js
// Loads the PDF reference document
getARenderJS().loadDocument(
"loadingQuery?url=http://www.arender.fr/pdf/pdf/PDFReference15_v5.pdf",
function(id) { getARenderJS().openDocument(id); }
);
// Move to page 24 (note that page index is starting at 0. So page 1 has index 0)
getARenderJS().askChangePage('Index',23);
// Move to last page
getARenderJS().askChangePage('Absolute',1);

Multiple document opening

ARender provides the possibility to open several documents by loading a list of documents which will be provided via JSON in order to define the tree structure. All the technical details can be found here