TWViewerPdfApp

TWViewerPdfApp

TWViewerPdfApp is the main class for the viewer application.

Constructor

# new TWViewerPdfApp()

Source:

Members

# bookmarkLayer :BookmarkLayer

Bookmark layer manager

Source:

# id :number

Id of the viewer app.

Type:
  • number
Source:

# options :object

Initial viewer app options.

Type:
  • object
Source:

# pdfDocument :PDFDocument

The loaded PDF document.

Type:
  • PDFDocument
Source:

# textSelectionOptions :TextSelectionOptions

Text selection options.

Source:

# toolbar :Toolbar

Toolbar.

Type:
Source:

# viewerDiv :HTMLdivElement

The main container for the viewer app.

Type:
  • HTMLdivElement
Source:

# zoomService :ZoomService

Zoom service.

Type:
Source:

Methods

# activateMultiPageView()

Activates the multi-page view mode.

Source:

# activateSinglePageView()

Activates the single-page view mode.

Source:

# disableSelection(val)

Disables the text selection.

Parameters:
Name Type Description
val boolean
Source:

# downloadDocument()

Downloads the loaded document.

Source:

# getDocumentName() → {string}

Get currently loaded document name.

Source:
Returns:
Type
string

# getPageTextContent(pageIndex) → {string}

Returns the text content of the page.

Parameters:
Name Type Description
pageIndex number

Page index of the page. Numbering starts from 0.

Source:
Returns:

The text content of the page.

Type
string

# gotoPage(num)

Goes to the specified page.

Parameters:
Name Type Description
num number

The page number.

Source:

# loadDocumentFromFile(file, password, app)

Loads the document from the specified file.

Parameters:
Name Type Description
file file

The file of the document.

password string

The password of the document.

app TWViewerPdfApp

The application.

Source:

# loadDocumentFromUrl(url, password, app)

Loads the document from the specified URL.

Parameters:
Name Type Description
url string

The URL of the document.

password string

The password of the document.

app TWViewerPdfApp

The application.

Source:

# nextPage()

Shows the next page.

Source:

# nextVisited()

Shows next visited page from the history of the visited pages.

Source:

# openDocumentProperties()

Opens the document's properties.

Source:

# openThroughDialog()

Opens a file dialog and loads the selected PDF file.

Source:

# previousPage()

Shows the previous page.

Source:

# prevVisited()

Shows previously visited page from the history of the visited pages.

Source:

# print()

Prints the document by opening a new window.

Source:

# releasePdfDoc()

Releases the loaded document.

Source:

# rotateClockwise()

Rotates the document by 90 degrees clockwise.

Source:

# rotateCounterClockwise()

Rotates the document by 90 degrees counter-clockwise.

Source:

# showDocumentProperties()

Shows the document properties.

Source:

# showError(error)

Shows the error message.

Parameters:
Name Type Description
error string

The error message.

Source:

# showMsg(msg, type)

Shows the message.

Parameters:
Name Type Description
msg string

The message to show.

type string

Available values: "info", "error".

Source: