Skip to main content

Classic to Horizon call table

What to call on window.ARender instead of each arender.jsapi call from the Classic viewer, for the entry points available in Horizon today.

For concepts rather than entry points — delivery model, embedding, configuration — see Migration from GWT. For the full Horizon command list, see the JavaScript API reference.

Page numbers are zero-based on both sides

The Horizon API counts pages from zero, same as the backend itself — only the viewer's own page indicator in the UI displays one more. Rows carrying a page number are marked (0-based) below.

Document reading and navigation​

Classic callHorizon
getCurrentDocumentId()getCurrentDocumentId()
getMasterDocumentId()getRootDocumentId()
askChangeDocument("Next")nextDocument()
askChangeDocument("Previous")previousDocument()
askChangeDocument("ByDocumentId", documentId)goToDocument(documentId)
askChangePage("Index", page) (0-based)goToPage(page)
getDocumentLayout().getDocumentLayout(documentId, onLayout, onError)getDocumentLayout(documentId?) — synchronous, no callbacks
getDocumentMetadata().getDocumentMetadata(documentId, handler)getDocumentMetadata(documentId?)

Search commands​

Classic callHorizon
getSearchJSAPI().askSearchTextNext(text)await search(text), then handle.next()
getSearchJSAPI().askSearchTextPrevious(text)await search(text), then handle.previous()
getSearchJSAPI().clearSearchResults()handle.dispose()

Download​

Classic callHorizon
getDownloadDocumentJSAPI().askDownloadDocumentPDF()download({format: 'pdf'})
getDownloadDocumentJSAPI().askDownloadDocumentSource()download({format: 'original'})
getDownloadDocumentJSAPI().askDownloadAllDocuments()download({format: 'pdf', documents: 'all'})
getDownloadDocumentJSAPI().askDownloadWithAnnotations()download({annotations: 'editable'})
getDownloadDocumentJSAPI().askDownloadWithRedact()download({annotations: 'flatten'})
askDownloadDocument(documentId, title, suffix)download() — always targets the document on screen, no by-id variant

Annotations​

Classic callHorizon
annotjs.addAnnotation(documentId, type, x, y, w, h, page, color, opacity) (0-based)annotations.create({page, type, x, y, width, height, color, opacity})
annotjs.refresh()annotations.refresh(documentId?)
annotjs.registerNotifyAnnotationAddedEvent(cb)on('annotations.created', cb)
annotjs.registerNotifyAnnotationUpdatedEvent(cb)on('annotations.updated', cb)
annotjs.registerNotifyAnnotationDeletedEvent(cb)on('annotations.deleted', cb)

Events​

Classic callHorizon
registerNotifyPageChangeEvent(cb)on('page.changed', cb)
registerCurrentDocumentChangeEvent(cb)on('document.changed', cb)
registerNotifyLoadingErrorEvent(cb)on('document.loadFailed', cb)
registerAnnotationsSavedEvent(cb)on('annotations.created' | 'annotations.updated' | 'annotations.deleted', cb) — Horizon writes each annotation as it is made, so there is no batched "saved" event