%PDF-1.4 %Óëéá 1 0 obj <> endobj 3 0 obj <> endobj 4 0 obj <
| Server IP : 212.252.79.165 / Your IP : 216.73.216.226 [ Web Server : Apache System : Linux 212-252-79-165.cprapid.com 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64 User : cehaburo ( 1001) PHP Version : 8.1.33 Disable Function : exec,passthru,shell_exec,system Domains : 48 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/cehaburo/public_html/pdfjs/doc/ |
Upload File : |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>PDFJS Express WebViewer Class: Document</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.pdftron.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top ">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">PDFJS Express WebViewer</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="topNavigation">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="Core.html">Core</a></li><li><a href="Core.Actions.html">Core.Actions</a></li><li><a href="Core.Annotations.html">Core.Annotations</a></li><li><a href="Core.ContentEdit.html">Core.ContentEdit</a></li><li><a href="Core.Math.html">Core.Math</a></li><li><a href="Core.PartRetrievers.html">Core.PartRetrievers</a></li><li><a href="Core.Search.html">Core.Search</a></li><li><a href="Core.Tools.html">Core.Tools</a></li><li><a href="UI.html">UI</a></li><li><a href="UI.Fonts.html">UI.Fonts</a></li><li><a href="UI.Hotkeys.html">UI.Hotkeys</a></li><li><a href="UI.NotesPanel.html">UI.NotesPanel</a></li><li><a href="UI.TabManager.html">UI.TabManager</a></li><li><a href="UI.ThumbnailsPanel.html">UI.ThumbnailsPanel</a></li><li><a href="UI.VerificationOptions.html">UI.VerificationOptions</a></li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="Core.Actions.Action.html">Core.Actions.Action</a></li><li><a href="Core.Actions.Dest.html">Core.Actions.Dest</a></li><li><a href="Core.Actions.GoTo.html">Core.Actions.GoTo</a></li><li><a href="Core.Actions.GoToR.html">Core.Actions.GoToR</a></li><li><a href="Core.Actions.Hide.html">Core.Actions.Hide</a></li><li><a href="Core.Actions.JavaScript.html">Core.Actions.JavaScript</a></li><li><a href="Core.Actions.Named.html">Core.Actions.Named</a></li><li><a href="Core.Actions.ResetForm.html">Core.Actions.ResetForm</a></li><li><a href="Core.Actions.SubmitForm.html">Core.Actions.SubmitForm</a></li><li><a href="Core.Actions.URI.html">Core.Actions.URI</a></li><li><a href="Core.AnnotationHistoryManager.html">Core.AnnotationHistoryManager</a></li><li><a href="Core.AnnotationManager.html">Core.AnnotationManager</a></li><li><a href="Core.Annotations.Annotation.html">Core.Annotations.Annotation</a></li><li><a href="Core.Annotations.ArcAnnotation.html">Core.Annotations.ArcAnnotation</a></li><li><a href="Core.Annotations.Border.html">Core.Annotations.Border</a></li><li><a href="Core.Annotations.BoxControlHandle.html">Core.Annotations.BoxControlHandle</a></li><li><a href="Core.Annotations.BoxSelectionModel.html">Core.Annotations.BoxSelectionModel</a></li><li><a href="Core.Annotations.ButtonWidgetAnnotation.html">Core.Annotations.ButtonWidgetAnnotation</a></li><li><a href="Core.Annotations.CalloutControlHandle.html">Core.Annotations.CalloutControlHandle</a></li><li><a href="Core.Annotations.CalloutSelectionModel.html">Core.Annotations.CalloutSelectionModel</a></li><li><a href="Core.Annotations.CanvasHelper.html">Core.Annotations.CanvasHelper</a></li><li><a href="Core.Annotations.CaretAnnotation.html">Core.Annotations.CaretAnnotation</a></li><li><a href="Core.Annotations.CheckButtonWidgetAnnotation.html">Core.Annotations.CheckButtonWidgetAnnotation</a></li><li><a href="Core.Annotations.ChoiceWidgetAnnotation.html">Core.Annotations.ChoiceWidgetAnnotation</a></li><li><a href="Core.Annotations.Color.html">Core.Annotations.Color</a></li><li><a href="Core.Annotations.ControlHandle.html">Core.Annotations.ControlHandle</a></li><li><a href="Core.Annotations.CustomAnnotation.html">Core.Annotations.CustomAnnotation</a></li><li><a href="Core.Annotations.DatePickerWidgetAnnotation.html">Core.Annotations.DatePickerWidgetAnnotation</a></li><li><a href="Core.Annotations.EllipseAnnotation.html">Core.Annotations.EllipseAnnotation</a></li><li><a href="Core.Annotations.FileAttachmentAnnotation.html">Core.Annotations.FileAttachmentAnnotation</a></li><li><a href="Core.Annotations.Font.html">Core.Annotations.Font</a></li><li><a href="Core.Annotations.Forms.html">Core.Annotations.Forms</a></li><li><a href="Core.Annotations.Forms.EmbeddedJS.html">Core.Annotations.Forms.EmbeddedJS</a></li><li><a href="Core.Annotations.Forms.Field.html">Core.Annotations.Forms.Field</a></li><li><a href="Core.Annotations.Forms.FieldManager.html">Core.Annotations.Forms.FieldManager</a></li><li><a href="Core.Annotations.FreeHandAnnotation.html">Core.Annotations.FreeHandAnnotation</a></li><li><a href="Core.Annotations.FreeTextAnnotation.html">Core.Annotations.FreeTextAnnotation</a></li><li><a href="Core.Annotations.FreeTextAnnotation.RichTextEditor.html">Core.Annotations.FreeTextAnnotation.RichTextEditor</a></li><li><a href="Core.Annotations.FreeTextSelectionModel.html">Core.Annotations.FreeTextSelectionModel</a></li><li><a href="Core.Annotations.HTMLAnnotation.html">Core.Annotations.HTMLAnnotation</a></li><li><a href="Core.Annotations.IPathAnnotation.html">Core.Annotations.IPathAnnotation</a></li><li><a href="Core.Annotations.LineAnnotation.html">Core.Annotations.LineAnnotation</a></li><li><a href="Core.Annotations.LineControlHandle.html">Core.Annotations.LineControlHandle</a></li><li><a href="Core.Annotations.LineSelectionModel.html">Core.Annotations.LineSelectionModel</a></li><li><a href="Core.Annotations.Link.html">Core.Annotations.Link</a></li><li><a href="Core.Annotations.ListWidgetAnnotation.html">Core.Annotations.ListWidgetAnnotation</a></li><li><a href="Core.Annotations.MarkupAnnotation.html">Core.Annotations.MarkupAnnotation</a></li><li><a href="Core.Annotations.Model3D.html">Core.Annotations.Model3D</a></li><li><a href="Core.Annotations.PathControlHandle.html">Core.Annotations.PathControlHandle</a></li><li><a href="Core.Annotations.PathSelectionModel.html">Core.Annotations.PathSelectionModel</a></li><li><a href="Core.Annotations.PolygonAnnotation.html">Core.Annotations.PolygonAnnotation</a></li><li><a href="Core.Annotations.PolygonControlHandle.html">Core.Annotations.PolygonControlHandle</a></li><li><a href="Core.Annotations.PolygonSelectionModel.html">Core.Annotations.PolygonSelectionModel</a></li><li><a href="Core.Annotations.PolylineAnnotation.html">Core.Annotations.PolylineAnnotation</a></li><li><a href="Core.Annotations.PopupAnnotation.html">Core.Annotations.PopupAnnotation</a></li><li><a href="Core.Annotations.RadioButtonWidgetAnnotation.html">Core.Annotations.RadioButtonWidgetAnnotation</a></li><li><a href="Core.Annotations.RectangleAnnotation.html">Core.Annotations.RectangleAnnotation</a></li><li><a href="Core.Annotations.RedactionAnnotation.html">Core.Annotations.RedactionAnnotation</a></li><li><a href="Core.Annotations.RedactionSelectionModel.html">Core.Annotations.RedactionSelectionModel</a></li><li><a href="Core.Annotations.RotationControlHandle.html">Core.Annotations.RotationControlHandle</a></li><li><a href="Core.Annotations.RotationUtils.html">Core.Annotations.RotationUtils</a></li><li><a href="Core.Annotations.SelectionAlgorithm.html">Core.Annotations.SelectionAlgorithm</a></li><li><a href="Core.Annotations.SelectionModel.html">Core.Annotations.SelectionModel</a></li><li><a href="Core.Annotations.SignatureWidgetAnnotation.html">Core.Annotations.SignatureWidgetAnnotation</a></li><li><a href="Core.Annotations.SoundAnnotation.html">Core.Annotations.SoundAnnotation</a></li><li><a href="Core.Annotations.StampAnnotation.html">Core.Annotations.StampAnnotation</a></li><li><a href="Core.Annotations.StickyAnnotation.html">Core.Annotations.StickyAnnotation</a></li><li><a href="Core.Annotations.TextHighlightAnnotation.html">Core.Annotations.TextHighlightAnnotation</a></li><li><a href="Core.Annotations.TextMarkupAnnotation.html">Core.Annotations.TextMarkupAnnotation</a></li><li><a href="Core.Annotations.TextRedactAnnotation.html">Core.Annotations.TextRedactAnnotation</a></li><li><a href="Core.Annotations.TextSelectionModel.html">Core.Annotations.TextSelectionModel</a></li><li><a href="Core.Annotations.TextSquigglyAnnotation.html">Core.Annotations.TextSquigglyAnnotation</a></li><li><a href="Core.Annotations.TextStrikeoutAnnotation.html">Core.Annotations.TextStrikeoutAnnotation</a></li><li><a href="Core.Annotations.TextUnderlineAnnotation.html">Core.Annotations.TextUnderlineAnnotation</a></li><li><a href="Core.Annotations.TextWidgetAnnotation.html">Core.Annotations.TextWidgetAnnotation</a></li><li><a href="Core.Annotations.WidgetAnnotation.html">Core.Annotations.WidgetAnnotation</a></li><li><a href="Core.Annotations.WidgetFlags.html">Core.Annotations.WidgetFlags</a></li><li><a href="Core.Annotations.XFDFUtils.html">Core.Annotations.XFDFUtils</a></li><li><a href="Core.Bookmark.html">Core.Bookmark</a></li><li><a href="Core.DisplayMode.html">Core.DisplayMode</a></li><li><a href="Core.DisplayModeManager.html">Core.DisplayModeManager</a></li><li><a href="Core.Document.html">Core.Document</a></li><li><a href="Core.DocumentViewer.html">Core.DocumentViewer</a></li><li><a href="Core.EditBoxManager.html">Core.EditBoxManager</a></li><li><a href="Core.EventHandler.html">Core.EventHandler</a></li><li><a href="Core.Math.Matrix.html">Core.Math.Matrix</a></li><li><a href="Core.Math.Point.html">Core.Math.Point</a></li><li><a href="Core.Math.Quad.html">Core.Math.Quad</a></li><li><a href="Core.Math.Rect.html">Core.Math.Rect</a></li><li><a href="Core.Math.TransformationBuilder.html">Core.Math.TransformationBuilder</a></li><li><a href="Core.MeasurementManager.html">Core.MeasurementManager</a></li><li><a href="Core.PartRetrievers.PartRetriever.html">Core.PartRetrievers.PartRetriever</a></li><li><a href="Core.Scale.html">Core.Scale</a></li><li><a href="Core.Tools.AnnotationEditTool.html">Core.Tools.AnnotationEditTool</a></li><li><a href="Core.Tools.AnnotationSelectTool.html">Core.Tools.AnnotationSelectTool</a></li><li><a href="Core.Tools.ArcCreateTool.html">Core.Tools.ArcCreateTool</a></li><li><a href="Core.Tools.ArcMeasurementCreateTool.html">Core.Tools.ArcMeasurementCreateTool</a></li><li><a href="Core.Tools.AreaMeasurementCreateTool.html">Core.Tools.AreaMeasurementCreateTool</a></li><li><a href="Core.Tools.ArrowCreateTool.html">Core.Tools.ArrowCreateTool</a></li><li><a href="Core.Tools.CalloutCreateTool.html">Core.Tools.CalloutCreateTool</a></li><li><a href="Core.Tools.ChangeViewCreateTool.html">Core.Tools.ChangeViewCreateTool</a></li><li><a href="Core.Tools.CheckBoxFormFieldCreateTool.html">Core.Tools.CheckBoxFormFieldCreateTool</a></li><li><a href="Core.Tools.CloudyRectangularAreaMeasurementTool.html">Core.Tools.CloudyRectangularAreaMeasurementTool</a></li><li><a href="Core.Tools.ComboBoxFormFieldCreateTool.html">Core.Tools.ComboBoxFormFieldCreateTool</a></li><li><a href="Core.Tools.ContentEditTool.html">Core.Tools.ContentEditTool</a></li><li><a href="Core.Tools.CountMeasurementCreateTool.html">Core.Tools.CountMeasurementCreateTool</a></li><li><a href="Core.Tools.DateFreeTextCreateTool.html">Core.Tools.DateFreeTextCreateTool</a></li><li><a href="Core.Tools.DistanceMeasurementCreateTool.html">Core.Tools.DistanceMeasurementCreateTool</a></li><li><a href="Core.Tools.EllipseCreateTool.html">Core.Tools.EllipseCreateTool</a></li><li><a href="Core.Tools.EllipseMeasurementCreateTool.html">Core.Tools.EllipseMeasurementCreateTool</a></li><li><a href="Core.Tools.EraserTool.html">Core.Tools.EraserTool</a></li><li><a href="Core.Tools.FileAttachmentCreateTool.html">Core.Tools.FileAttachmentCreateTool</a></li><li><a href="Core.Tools.FreeHandCreateTool.html">Core.Tools.FreeHandCreateTool</a></li><li><a href="Core.Tools.FreeHandHighlightCreateTool.html">Core.Tools.FreeHandHighlightCreateTool</a></li><li><a href="Core.Tools.FreeTextCreateTool.html">Core.Tools.FreeTextCreateTool</a></li><li><a href="Core.Tools.GenericAnnotationCreateTool.html">Core.Tools.GenericAnnotationCreateTool</a></li><li><a href="Core.Tools.LineCreateTool.html">Core.Tools.LineCreateTool</a></li><li><a href="Core.Tools.ListBoxFormFieldCreateTool.html">Core.Tools.ListBoxFormFieldCreateTool</a></li><li><a href="Core.Tools.MarqueeZoomTool.html">Core.Tools.MarqueeZoomTool</a></li><li><a href="Core.Tools.PageCoordinate.html">Core.Tools.PageCoordinate</a></li><li><a href="Core.Tools.PanTool.html">Core.Tools.PanTool</a></li><li><a href="Core.Tools.PerimeterMeasurementCreateTool.html">Core.Tools.PerimeterMeasurementCreateTool</a></li><li><a href="Core.Tools.PolygonCloudCreateTool.html">Core.Tools.PolygonCloudCreateTool</a></li><li><a href="Core.Tools.PolygonCreateTool.html">Core.Tools.PolygonCreateTool</a></li><li><a href="Core.Tools.PolylineCreateTool.html">Core.Tools.PolylineCreateTool</a></li><li><a href="Core.Tools.RadioButtonFormFieldCreateTool.html">Core.Tools.RadioButtonFormFieldCreateTool</a></li><li><a href="Core.Tools.RectangleCreateTool.html">Core.Tools.RectangleCreateTool</a></li><li><a href="Core.Tools.RectangularAreaMeasurementTool.html">Core.Tools.RectangularAreaMeasurementTool</a></li><li><a href="Core.Tools.RedactionCreateTool.html">Core.Tools.RedactionCreateTool</a></li><li><a href="Core.Tools.RubberStampCreateTool.html">Core.Tools.RubberStampCreateTool</a></li><li><a href="Core.Tools.SignatureCreateTool.html">Core.Tools.SignatureCreateTool</a></li><li><a href="Core.Tools.StampCreateTool.html">Core.Tools.StampCreateTool</a></li><li><a href="Core.Tools.StickyCreateTool.html">Core.Tools.StickyCreateTool</a></li><li><a href="Core.Tools.TextAnnotationCreateTool.html">Core.Tools.TextAnnotationCreateTool</a></li><li><a href="Core.Tools.TextFormFieldCreateTool.html">Core.Tools.TextFormFieldCreateTool</a></li><li><a href="Core.Tools.TextHighlightCreateTool.html">Core.Tools.TextHighlightCreateTool</a></li><li><a href="Core.Tools.TextSelectTool.html">Core.Tools.TextSelectTool</a></li><li><a href="Core.Tools.TextSquigglyCreateTool.html">Core.Tools.TextSquigglyCreateTool</a></li><li><a href="Core.Tools.TextStrikeoutCreateTool.html">Core.Tools.TextStrikeoutCreateTool</a></li><li><a href="Core.Tools.TextTool.html">Core.Tools.TextTool</a></li><li><a href="Core.Tools.TextUnderlineCreateTool.html">Core.Tools.TextUnderlineCreateTool</a></li><li><a href="Core.Tools.Tool.html">Core.Tools.Tool</a></li><li><a href="TextHighlightAnnotation.html">TextHighlightAnnotation</a></li><li><a href="UI.Header.html">UI.Header</a></li><li><a href="UI.MentionsManager.html">UI.MentionsManager</a></li><li><a href="WebViewerInstance.html">WebViewerInstance</a></li>
</ul>
</li>
<li class="dropdown">
<a href="events.list.html" class="dropdown-toggle" data-toggle="dropdown">Events<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="Core.AnnotationHistoryManager.html#event:historyChanged">Core.AnnotationHistoryManager#event:historyChanged</a></li><li><a href="Core.AnnotationManager.html#event:addReply">Core.AnnotationManager#event:addReply</a></li><li><a href="Core.AnnotationManager.html#event:annotationChanged">Core.AnnotationManager#event:annotationChanged</a></li><li><a href="Core.AnnotationManager.html#event:annotationDeselected">Core.AnnotationManager#event:annotationDeselected</a></li><li><a href="Core.AnnotationManager.html#event:annotationDoubleClicked">Core.AnnotationManager#event:annotationDoubleClicked</a></li><li><a href="Core.AnnotationManager.html#event:annotationHidden">Core.AnnotationManager#event:annotationHidden</a></li><li><a href="Core.AnnotationManager.html#event:annotationsDrawn">Core.AnnotationManager#event:annotationsDrawn</a></li><li><a href="Core.AnnotationManager.html#event:annotationSelected">Core.AnnotationManager#event:annotationSelected</a></li><li><a href="Core.AnnotationManager.html#event:deleteReply">Core.AnnotationManager#event:deleteReply</a></li><li><a href="Core.AnnotationManager.html#event:fieldChanged">Core.AnnotationManager#event:fieldChanged</a></li><li><a href="Core.AnnotationManager.html#event:fileAttachmentDataAvailable">Core.AnnotationManager#event:fileAttachmentDataAvailable</a></li><li><a href="Core.AnnotationManager.html#event:setNoteText">Core.AnnotationManager#event:setNoteText</a></li><li><a href="Core.AnnotationManager.html#event:updateAnnotationPermission">Core.AnnotationManager#event:updateAnnotationPermission</a></li><li><a href="Core.Annotations.Forms.Field.html#event:calculate">Core.Annotations.Forms.Field#event:calculate</a></li><li><a href="Core.Annotations.Forms.Field.html#event:change">Core.Annotations.Forms.Field#event:change</a></li><li><a href="Core.Annotations.Forms.Field.html#event:commit">Core.Annotations.Forms.Field#event:commit</a></li><li><a href="Core.ContentEdit.html#event:editBoxesAvailable">Core.ContentEdit#event:editBoxesAvailable</a></li><li><a href="Core.ContentEdit.html#event:textContentUpdated">Core.ContentEdit#event:textContentUpdated</a></li><li><a href="Core.Document.html#event:colorSeparationAdded">Core.Document#event:colorSeparationAdded</a></li><li><a href="Core.Document.html#event:layersUpdated">Core.Document#event:layersUpdated</a></li><li><a href="Core.DocumentViewer.html#event:activeSearchResultChanged">Core.DocumentViewer#event:activeSearchResultChanged</a></li><li><a href="Core.DocumentViewer.html#event:annotationsLoaded">Core.DocumentViewer#event:annotationsLoaded</a></li><li><a href="Core.DocumentViewer.html#event:beforeDocumentLoaded">Core.DocumentViewer#event:beforeDocumentLoaded</a></li><li><a href="Core.DocumentViewer.html#event:beginRendering">Core.DocumentViewer#event:beginRendering</a></li><li><a href="Core.DocumentViewer.html#event:click">Core.DocumentViewer#event:click</a></li><li><a href="Core.DocumentViewer.html#event:dblClick">Core.DocumentViewer#event:dblClick</a></li><li><a href="Core.DocumentViewer.html#event:displayModeUpdated">Core.DocumentViewer#event:displayModeUpdated</a></li><li><a href="Core.DocumentViewer.html#event:displayPageLocation">Core.DocumentViewer#event:displayPageLocation</a></li><li><a href="Core.DocumentViewer.html#event:documentLoaded">Core.DocumentViewer#event:documentLoaded</a></li><li><a href="Core.DocumentViewer.html#event:documentUnloaded">Core.DocumentViewer#event:documentUnloaded</a></li><li><a href="Core.DocumentViewer.html#event:embeddedThumbnailComplete">Core.DocumentViewer#event:embeddedThumbnailComplete</a></li><li><a href="Core.DocumentViewer.html#event:finishedRendering">Core.DocumentViewer#event:finishedRendering</a></li><li><a href="Core.DocumentViewer.html#event:fitModeUpdated">Core.DocumentViewer#event:fitModeUpdated</a></li><li><a href="Core.DocumentViewer.html#event:keyDown">Core.DocumentViewer#event:keyDown</a></li><li><a href="Core.DocumentViewer.html#event:keyUp">Core.DocumentViewer#event:keyUp</a></li><li><a href="Core.DocumentViewer.html#event:mouseEnter">Core.DocumentViewer#event:mouseEnter</a></li><li><a href="Core.DocumentViewer.html#event:mouseLeave">Core.DocumentViewer#event:mouseLeave</a></li><li><a href="Core.DocumentViewer.html#event:mouseLeftDown">Core.DocumentViewer#event:mouseLeftDown</a></li><li><a href="Core.DocumentViewer.html#event:mouseLeftUp">Core.DocumentViewer#event:mouseLeftUp</a></li><li><a href="Core.DocumentViewer.html#event:mouseMove">Core.DocumentViewer#event:mouseMove</a></li><li><a href="Core.DocumentViewer.html#event:mouseRightDown">Core.DocumentViewer#event:mouseRightDown</a></li><li><a href="Core.DocumentViewer.html#event:mouseRightUp">Core.DocumentViewer#event:mouseRightUp</a></li><li><a href="Core.DocumentViewer.html#event:notify">Core.DocumentViewer#event:notify</a></li><li><a href="Core.DocumentViewer.html#event:pageComplete">Core.DocumentViewer#event:pageComplete</a></li><li><a href="Core.DocumentViewer.html#event:pageNumberUpdated">Core.DocumentViewer#event:pageNumberUpdated</a></li><li><a href="Core.DocumentViewer.html#event:pagesUpdated">Core.DocumentViewer#event:pagesUpdated</a></li><li><a href="Core.DocumentViewer.html#event:rotationUpdated">Core.DocumentViewer#event:rotationUpdated</a></li><li><a href="Core.DocumentViewer.html#event:searchInProgress">Core.DocumentViewer#event:searchInProgress</a></li><li><a href="Core.DocumentViewer.html#event:searchResultsChanged">Core.DocumentViewer#event:searchResultsChanged</a></li><li><a href="Core.DocumentViewer.html#event:tap">Core.DocumentViewer#event:tap</a></li><li><a href="Core.DocumentViewer.html#event:textSelected">Core.DocumentViewer#event:textSelected</a></li><li><a href="Core.DocumentViewer.html#event:toolModeUpdated">Core.DocumentViewer#event:toolModeUpdated</a></li><li><a href="Core.DocumentViewer.html#event:toolUpdated">Core.DocumentViewer#event:toolUpdated</a></li><li><a href="Core.DocumentViewer.html#event:zoomUpdated">Core.DocumentViewer#event:zoomUpdated</a></li><li><a href="Core.EditBoxManager.html#event:editorBlur">Core.EditBoxManager#event:editorBlur</a></li><li><a href="Core.EditBoxManager.html#event:editorFocus">Core.EditBoxManager#event:editorFocus</a></li><li><a href="Core.EditBoxManager.html#event:editorSelectionChanged">Core.EditBoxManager#event:editorSelectionChanged</a></li><li><a href="Core.EditBoxManager.html#event:editorTextChanged">Core.EditBoxManager#event:editorTextChanged</a></li><li><a href="Core.MeasurementManager.html#event:scaleUpdated">Core.MeasurementManager#event:scaleUpdated</a></li><li><a href="Core.Tools.ArcCreateTool.html#event:annotationAdded">Core.Tools.ArcCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.ArcCreateTool.html#event:annotationCreated">Core.Tools.ArcCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.ArcMeasurementCreateTool.html#event:annotationAdded">Core.Tools.ArcMeasurementCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.ArcMeasurementCreateTool.html#event:annotationCreated">Core.Tools.ArcMeasurementCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.AreaMeasurementCreateTool.html#event:annotationAdded">Core.Tools.AreaMeasurementCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.AreaMeasurementCreateTool.html#event:annotationCreated">Core.Tools.AreaMeasurementCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.ArrowCreateTool.html#event:annotationAdded">Core.Tools.ArrowCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.ArrowCreateTool.html#event:annotationCreated">Core.Tools.ArrowCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.CalloutCreateTool.html#event:annotationAdded">Core.Tools.CalloutCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.CalloutCreateTool.html#event:annotationCreated">Core.Tools.CalloutCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.ChangeViewCreateTool.html#event:annotationAdded">Core.Tools.ChangeViewCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.ChangeViewCreateTool.html#event:annotationCreated">Core.Tools.ChangeViewCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.CheckBoxFormFieldCreateTool.html#event:annotationAdded">Core.Tools.CheckBoxFormFieldCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.CheckBoxFormFieldCreateTool.html#event:annotationCreated">Core.Tools.CheckBoxFormFieldCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.CloudyRectangularAreaMeasurementTool.html#event:annotationAdded">Core.Tools.CloudyRectangularAreaMeasurementTool#event:annotationAdded</a></li><li><a href="Core.Tools.CloudyRectangularAreaMeasurementTool.html#event:annotationCreated">Core.Tools.CloudyRectangularAreaMeasurementTool#event:annotationCreated</a></li><li><a href="Core.Tools.ComboBoxFormFieldCreateTool.html#event:annotationAdded">Core.Tools.ComboBoxFormFieldCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.ComboBoxFormFieldCreateTool.html#event:annotationCreated">Core.Tools.ComboBoxFormFieldCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.CountMeasurementCreateTool.html#event:annotationAdded">Core.Tools.CountMeasurementCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.CountMeasurementCreateTool.html#event:annotationCreated">Core.Tools.CountMeasurementCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.CropCreateTool.html#event:cropApplied">Core.Tools.CropCreateTool#event:cropApplied</a></li><li><a href="Core.Tools.DateFreeTextCreateTool.html#event:annotationAdded">Core.Tools.DateFreeTextCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.DateFreeTextCreateTool.html#event:annotationCreated">Core.Tools.DateFreeTextCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.DistanceMeasurementCreateTool.html#event:annotationAdded">Core.Tools.DistanceMeasurementCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.DistanceMeasurementCreateTool.html#event:annotationCreated">Core.Tools.DistanceMeasurementCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.EllipseCreateTool.html#event:annotationAdded">Core.Tools.EllipseCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.EllipseCreateTool.html#event:annotationCreated">Core.Tools.EllipseCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.EllipseMeasurementCreateTool.html#event:annotationAdded">Core.Tools.EllipseMeasurementCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.EllipseMeasurementCreateTool.html#event:annotationCreated">Core.Tools.EllipseMeasurementCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.EraserTool.html#event:annotationAdded">Core.Tools.EraserTool#event:annotationAdded</a></li><li><a href="Core.Tools.EraserTool.html#event:annotationCreated">Core.Tools.EraserTool#event:annotationCreated</a></li><li><a href="Core.Tools.EraserTool.html#event:erasingAnnotation">Core.Tools.EraserTool#event:erasingAnnotation</a></li><li><a href="Core.Tools.FreeHandCreateTool.html#event:annotationAdded">Core.Tools.FreeHandCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.FreeHandCreateTool.html#event:annotationCreated">Core.Tools.FreeHandCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.FreeHandHighlightCreateTool.html#event:annotationAdded">Core.Tools.FreeHandHighlightCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.FreeHandHighlightCreateTool.html#event:annotationCreated">Core.Tools.FreeHandHighlightCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.FreeTextCreateTool.html#event:annotationAdded">Core.Tools.FreeTextCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.FreeTextCreateTool.html#event:annotationCreated">Core.Tools.FreeTextCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.GenericAnnotationCreateTool.html#event:annotationAdded">Core.Tools.GenericAnnotationCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.GenericAnnotationCreateTool.html#event:annotationCreated">Core.Tools.GenericAnnotationCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.LineCreateTool.html#event:annotationAdded">Core.Tools.LineCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.LineCreateTool.html#event:annotationCreated">Core.Tools.LineCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.ListBoxFormFieldCreateTool.html#event:annotationAdded">Core.Tools.ListBoxFormFieldCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.ListBoxFormFieldCreateTool.html#event:annotationCreated">Core.Tools.ListBoxFormFieldCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.PerimeterMeasurementCreateTool.html#event:annotationAdded">Core.Tools.PerimeterMeasurementCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.PerimeterMeasurementCreateTool.html#event:annotationCreated">Core.Tools.PerimeterMeasurementCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.PolygonCloudCreateTool.html#event:annotationAdded">Core.Tools.PolygonCloudCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.PolygonCloudCreateTool.html#event:annotationCreated">Core.Tools.PolygonCloudCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.PolygonCreateTool.html#event:annotationAdded">Core.Tools.PolygonCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.PolygonCreateTool.html#event:annotationCreated">Core.Tools.PolygonCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.PolylineCreateTool.html#event:annotationAdded">Core.Tools.PolylineCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.PolylineCreateTool.html#event:annotationCreated">Core.Tools.PolylineCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.RadioButtonFormFieldCreateTool.html#event:annotationAdded">Core.Tools.RadioButtonFormFieldCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.RadioButtonFormFieldCreateTool.html#event:annotationCreated">Core.Tools.RadioButtonFormFieldCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.RectangleCreateTool.html#event:annotationAdded">Core.Tools.RectangleCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.RectangleCreateTool.html#event:annotationCreated">Core.Tools.RectangleCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.RectangularAreaMeasurementTool.html#event:annotationAdded">Core.Tools.RectangularAreaMeasurementTool#event:annotationAdded</a></li><li><a href="Core.Tools.RectangularAreaMeasurementTool.html#event:annotationCreated">Core.Tools.RectangularAreaMeasurementTool#event:annotationCreated</a></li><li><a href="Core.Tools.RedactionCreateTool.html#event:annotationAdded">Core.Tools.RedactionCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.RedactionCreateTool.html#event:annotationCreated">Core.Tools.RedactionCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.RubberStampCreateTool.html#event:annotationAdded">Core.Tools.RubberStampCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.SignatureCreateTool.html#event:annotationAdded">Core.Tools.SignatureCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.SignatureCreateTool.html#event:fileRejected">Core.Tools.SignatureCreateTool#event:fileRejected</a></li><li><a href="Core.Tools.SignatureCreateTool.html#event:locationSelected">Core.Tools.SignatureCreateTool#event:locationSelected</a></li><li><a href="Core.Tools.SignatureCreateTool.html#event:signatureDeleted">Core.Tools.SignatureCreateTool#event:signatureDeleted</a></li><li><a href="Core.Tools.SignatureCreateTool.html#event:signatureSaved">Core.Tools.SignatureCreateTool#event:signatureSaved</a></li><li><a href="Core.Tools.StampCreateTool.html#event:annotationAdded">Core.Tools.StampCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.StampCreateTool.html#event:fileRejected">Core.Tools.StampCreateTool#event:fileRejected</a></li><li><a href="Core.Tools.StickyCreateTool.html#event:annotationAdded">Core.Tools.StickyCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.StickyCreateTool.html#event:annotationCreated">Core.Tools.StickyCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.TextAnnotationCreateTool.html#event:annotationAdded">Core.Tools.TextAnnotationCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.TextAnnotationCreateTool.html#event:annotationCreated">Core.Tools.TextAnnotationCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.TextFormFieldCreateTool.html#event:annotationAdded">Core.Tools.TextFormFieldCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.TextFormFieldCreateTool.html#event:annotationCreated">Core.Tools.TextFormFieldCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.TextHighlightCreateTool.html#event:annotationAdded">Core.Tools.TextHighlightCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.TextHighlightCreateTool.html#event:annotationCreated">Core.Tools.TextHighlightCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.TextSelectTool.html#event:selectionComplete">Core.Tools.TextSelectTool#event:selectionComplete</a></li><li><a href="Core.Tools.TextSquigglyCreateTool.html#event:annotationAdded">Core.Tools.TextSquigglyCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.TextSquigglyCreateTool.html#event:annotationCreated">Core.Tools.TextSquigglyCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.TextStrikeoutCreateTool.html#event:annotationAdded">Core.Tools.TextStrikeoutCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.TextStrikeoutCreateTool.html#event:annotationCreated">Core.Tools.TextStrikeoutCreateTool#event:annotationCreated</a></li><li><a href="Core.Tools.TextUnderlineCreateTool.html#event:annotationAdded">Core.Tools.TextUnderlineCreateTool#event:annotationAdded</a></li><li><a href="Core.Tools.TextUnderlineCreateTool.html#event:annotationCreated">Core.Tools.TextUnderlineCreateTool#event:annotationCreated</a></li><li><a href="UI.MentionsManager.html#event:mentionChanged">UI.MentionsManager#event:mentionChanged</a></li><li><a href="UI.html#event:annotationFilterChanged">UI#event:annotationFilterChanged</a></li><li><a href="UI.html#event:beforeTabChanged">UI#event:beforeTabChanged</a></li><li><a href="UI.html#event:documentLoaded">UI#event:documentLoaded</a></li><li><a href="UI.html#event:documentMerged">UI#event:documentMerged</a></li><li><a href="UI.html#event:dragOutline">UI#event:dragOutline</a></li><li><a href="UI.html#event:fileDownloaded">UI#event:fileDownloaded</a></li><li><a href="UI.html#event:finishedSavingPDF">UI#event:finishedSavingPDF</a></li><li><a href="UI.html#event:fullscreenModeToggled">UI#event:fullscreenModeToggled</a></li><li><a href="UI.html#event:loaderror">UI#event:loaderror</a></li><li><a href="UI.html#event:outlineBookmarksChanged">UI#event:outlineBookmarksChanged</a></li><li><a href="UI.html#event:panelResized">UI#event:panelResized</a></li><li><a href="UI.html#event:selectedThumbnailChanged">UI#event:selectedThumbnailChanged</a></li><li><a href="UI.html#event:tabAdded">UI#event:tabAdded</a></li><li><a href="UI.html#event:tabDeleted">UI#event:tabDeleted</a></li><li><a href="UI.html#event:tabMoved">UI#event:tabMoved</a></li><li><a href="UI.html#event:themeChanged">UI#event:themeChanged</a></li><li><a href="UI.html#event:thumbnailDragged">UI#event:thumbnailDragged</a></li><li><a href="UI.html#event:thumbnailDropped">UI#event:thumbnailDropped</a></li><li><a href="UI.html#event:toolbarGroupChanged">UI#event:toolbarGroupChanged</a></li><li><a href="UI.html#event:userBookmarksChanged">UI#event:userBookmarksChanged</a></li><li><a href="UI.html#event:viewerLoaded">UI#event:viewerLoaded</a></li><li><a href="UI.html#event:visibilityChanged">UI#event:visibilityChanged</a></li>
</ul>
</li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="global.html#getInstance">getInstance</a></li><li><a href="global.html#WebViewer">WebViewer</a></li>
</ul>
</li>
</ul>
<div class="col-sm-3 col-md-3">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
<div class="input-group-btn">
<button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container" id="toc-content">
<div class="row">
<div class="col-md-8">
<div id="main">
<h1 class="page-title">Class: Document</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="Core.html">Core</a>.</span>
Document
</h2>
<div class="class-description">Represents a document.</div>
</header>
<article>
<div class="container-overview">
<hr>
<dt>
<h4 class="name" id="Document"><span class="type-signature"></span>new Document(id, type)</h4>
</dt>
<dd>
<div class="description">
Constructs a new empty Document, representing a document with individual pages (canvases) that can be displayed on screen and printed.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Unique string identifier for the document</td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The type of document that should be instantiated.
Values are 'xod' for XOD documents, 'pdf' for PDF, JPG or PNG documents, 'office' for MS Office documents and 'webviewerServer' for WebViewer Server documents</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li><a href="Core.EventHandler.html">Core.EventHandler</a></li>
</ul>
<h3 class="subsection-title">Methods</h3>
<dl>
<hr>
<dt>
<h4 class="name" id=".registerDocumentType"><span class="type-signature"><static> </span>registerDocumentType(type, source, exposedFuncs)</h4>
</dt>
<dd>
<div class="description">
Register new document type with Document class
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Name of the new document type</td>
</tr>
<tr>
<td class="name"><code>source</code></td>
<td class="type">
<span class="param-type">any</span>
</td>
<td class="description last">Class of the new document</td>
</tr>
<tr>
<td class="name"><code>exposedFuncs</code></td>
<td class="type">
<span class="param-type">Array.<string></span>
</td>
<td class="description last">An array containing strings of the function names to expose on the document object</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id=".unregisterDocumentType"><span class="type-signature"><static> </span>unregisterDocumentType(type)</h4>
</dt>
<dd>
<div class="description">
Unregister existing document type form Document class
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Name of registered document type</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="addEventListener"><span class="type-signature"></span>addEventListener(type, fn [, options])</h4>
</dt>
<dd>
<div class="description">
Add a handler to the given event name
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last">The name of the event to listen to</td>
</tr>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last">The handler to be called when the event is triggered</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Optional options object for addEventListener
<h6 class="method-params-label method-subparams-label">Properties</h6>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>once</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">If true then the handler will be called only once</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Core.EventHandler.html#addEventListener">Core.EventHandler#addEventListener</a>
</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the object that 'addEventListener' is being called on
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="sunlight-highlight-javascript">myObject.addEventListener('eventName', (eventParameter1, eventParameter2) => {
...
});</pre>
</dd>
<hr>
<dt>
<h4 class="name" id="applyTemplateValues"><span class="type-signature"></span>applyTemplateValues(templateValues)</h4>
</dt>
<dd>
<div class="description">
[Office Document only] Update a Document via binding template keys to content.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>templateValues</code></td>
<td class="type">
<span class="param-type"><a href="Core.html#.TemplateData">Core.TemplateData</a></span>
</td>
<td class="description last">The template replacement values.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-see method-doc-label method-doc-details-label">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://www.pdftron.com/documentation/web/guides/generate-via-template/data-model/">https://www.pdftron.com/documentation/web/guides/generate-via-template/data-model/</a> for the data model.</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Resolves when template data has been applied to the document, or rejects with an error.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="arePagesAltered"><span class="type-signature"></span>arePagesAltered()</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Check if the PDF Document has been altered with page modifications (Additions, deletions, rotations, crops).
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A boolean value indicating whether the PDF Document has been altered.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="cancelLoadCanvas"><span class="type-signature"></span>cancelLoadCanvas(id)</h4>
</dt>
<dd>
<div class="description">
Cancels the loadCanvasAsync call corresponding to the passed in id
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The id returned from the loadCanvasAsync call that will be cancelled.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="cancelLoadThumbnail"><span class="type-signature"></span>cancelLoadThumbnail(requestId)</h4>
</dt>
<dd>
<div class="description">
Cancels the request made for thumbnail with the specified request Id
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>requestId</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The id returned from loadThumbnailAsync</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="cancelOfflineModeDownload"><span class="type-signature"></span>cancelOfflineModeDownload()</h4>
</dt>
<dd>
<div class="description">
Cancels a download for offline mode in progress. If there is no current download then this does nothing.
</div>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="cropPages"><span class="type-signature"></span>cropPages(pageArray, topMargin, botMargin, leftMargin, rightMargin)</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Crop the given pages by the given margins. Note that this method will need to wait for the entire file to be downloaded before the change is applied.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageArray</code></td>
<td class="type">
<span class="param-type">Array.<number></span>
</td>
<td class="description last">an array of page numbers to crop</td>
</tr>
<tr>
<td class="name"><code>topMargin</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">how much to crop from the top</td>
</tr>
<tr>
<td class="name"><code>botMargin</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">how much to crop from the bottom</td>
</tr>
<tr>
<td class="name"><code>leftMargin</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">how much to crop from the left</td>
</tr>
<tr>
<td class="name"><code>rightMargin</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">how much to crop from the right</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a promise that resolves to an object describing the updated state of the pages in the document
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="disableColorSeparations"><span class="type-signature"></span>disableColorSeparations()</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Disable the color separations feature for rendering.
</div>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="disableOfflineMode"><span class="type-signature"></span>disableOfflineMode()</h4>
</dt>
<dd>
<div class="description">
[XOD Document only] Disable offline mode.
</div>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="documentCompletePromise"><span class="type-signature"></span>documentCompletePromise()</h4>
</dt>
<dd>
<dl class="details">
<dt class="important tag-deprecated method-doc-label method-doc-details-label">Deprecated:</dt>
<dd>
<ul class="dummy">
<li>Since version 8.3. Use <a href="Core.Document.html#getDocumentCompletePromise">getDocumentCompletePromise</a> instead.</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise that resolves when all of the page information is available for the document
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="enableColorSeparations"><span class="type-signature"></span>enableColorSeparations(options)</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Enables the color separations feature for rendering.
the boolean parameter is deprecated since version 8.0
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">The options parameter for color separation
<h6 class="method-params-label method-subparams-label">Properties</h6>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>checkIfBaseColorsUsed</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">Check if the base colors
Cyan, Magenta, Yellow and Black are actually used in the document, and if
not, prevents the Document.colorSeparationAdded event from firing for one
or more of those colors</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="enableOfflineMode"><span class="type-signature"></span>enableOfflineMode()</h4>
</dt>
<dd>
<div class="description">
[XOD Document only] Enable offline mode.
</div>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="enableSeparation"><span class="type-signature"></span>enableSeparation(name, enabled)</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Enables or disables the rendering of a particular color separation.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The name of the separation</td>
</tr>
<tr>
<td class="name"><code>enabled</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">Whether to enable or disable the separation</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="extractPages"><span class="type-signature"></span>extractPages(pageArray [, xfdfString])</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Extract the given pages from the document. Note that this method will need to wait for the entire file to be downloaded before the change is applied.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageArray</code></td>
<td class="type">
<span class="param-type">Array.<number></span>
</td>
<td class="attributes">
</td>
<td class="description last">an array of the page numbers to extract</td>
</tr>
<tr>
<td class="name"><code>xfdfString</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Optional XFDF string to merge into the document before extracting</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a promise that resolves on completion
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<any></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="extractPDFNetLayersContext"><span class="type-signature"></span>extractPDFNetLayersContext(layers)</h4>
</dt>
<dd>
<div class="description">
[PDF Document only][PDFNetJS full only] Get the updated context of a document as a PDFNet object.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>layers</code></td>
<td class="type">
</td>
<td class="description last">layers</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a promise that resolves to a PDFNet Context object representing the current layers/OCG state.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="extractXFDF"><span class="type-signature"></span>extractXFDF( [pages])</h4>
</dt>
<dd>
<div class="description">
Gets the XFDF data for the document's internal annotations.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pages</code></td>
<td class="type">
<span class="param-type">Array.<number></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">An array of page numbers to get the XFDF data for the document. Note: Only one page
is supported by XOD documents. For PDF documents if no parameter is passed then the XFDF data for the entire document is returned.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise that resolves to an object with an xfdfString property and a pages property where pages is the array of page numbers that annotations were extracted from
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<<a href="Core.Document.html#.XFDFInfo">Core.Document.XFDFInfo</a>></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getAuthId"><span class="type-signature"></span>getAuthId()</h4>
</dt>
<dd>
<div class="description">
[Server Document only] Get auth Id for current server document.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
the auth Id as a string.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getBookmarks"><span class="type-signature"></span>getBookmarks()</h4>
</dt>
<dd>
<div class="description">
Returns an array containing the bookmarks in the document.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise resolving to an array containing the bookmarks in the current document.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<Array.<<a href="Core.Bookmark.html">Core.Bookmark</a>>></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getClientId"><span class="type-signature"></span>getClientId()</h4>
</dt>
<dd>
<div class="description">
[Server Document only] Get client Id for current server document.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
the client Id as a string.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getColorSeparations"><span class="type-signature"></span>getColorSeparations()</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Gets the color separations available on this document.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The color separations of the document
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.<any></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getDestinations"><span class="type-signature"></span>getDestinations()</h4>
</dt>
<dd>
<div class="description">
Returns an object containing the destinations of the document.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
{Promise<object>} A promise that resolves to an object with document destinations.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getDocumentCompletePromise"><span class="type-signature"></span>getDocumentCompletePromise()</h4>
</dt>
<dd>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise that resolves when all of the page information is available for the document
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getDocumentId"><span class="type-signature"></span>getDocumentId()</h4>
</dt>
<dd>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
returns user defined document id passed in WebViewer constructor constorctor or loadDocument API, e.g.
WebViewer({ documentId: 'foo-11', initialDoc: 'url' }) or instance.loadDocument(url, { documentId: 'foo-11' })
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getDownloadLink"><span class="type-signature"></span>getDownloadLink( [options])</h4>
</dt>
<dd>
<div class="description">
[PDFTron Server only] Provides a URL to a the PDF with annotations and watermarks merged.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">An optional object containing download options and parameters.
<h6 class="method-params-label method-subparams-label">Properties</h6>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>filename</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The preferred name for the downloaded file on the client side. This has no effect on the backend target of the returned link, only the filename used by the browser when the link is accessed.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Will be null if not supported. Otherwise a promise that resolves to an object with a `url` property pointing to the printable PDF.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
|
<span class="param-type">null</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getFileData"><span class="type-signature"></span>getFileData()</h4>
</dt>
<dd>
<div class="description">
Asynchronously saves the document and provides the result as an ArrayBuffer.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a promise that resolves to an array buffer containing PDF document bytes.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<Array.<any>></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getFilename"><span class="type-signature"></span>getFilename()</h4>
</dt>
<dd>
<div class="description">
Get the document filename used for downloading.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
filename of the document.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getFileSize"><span class="type-signature"></span>getFileSize( [aggressionLevel])</h4>
</dt>
<dd>
<div class="description">
Get the size of the document in bytes. Throws if the size cannot be found.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>aggressionLevel</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
2
</td>
<td class="description last">Set the number of failed attempts to allow before throwing.
Each attempt calls a method that may take slighly longer than the previous.
The order of attempts are as follows:
1) Return the size immediately if we already have the data
2) Make a HEAD request to the server and attempt to read the 'content-length' header
3) Download the full document and return the size
For example, setting aggressionLevel to 1 only tries the first method, setting it to 3 tries all the methods.
The default is 2</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The number of bytes
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<number></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getLayersArray"><span class="type-signature"></span>getLayersArray()</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Get an array describing the layers/OCG structure in the document.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise that resolves to an array representing the layers in the PDF document
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<Array.<<a href="Core.Document.html#.LayerContext">Core.Document.LayerContext</a>>></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getLinks"><span class="type-signature"></span>getLinks(pageNumber)</h4>
</dt>
<dd>
<div class="description">
Returns an array containing the links on the specified page of the document.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number, one-indexed, that the links are on.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
An array containing the links on the specified page of the document.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.<string></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getMetadata"><span class="type-signature"></span>getMetadata()</h4>
</dt>
<dd>
<div class="description">
Returns an object with metadata associated with the document.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise that resolves to an object with document metadata
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getOfflineModeEnabled"><span class="type-signature"></span>getOfflineModeEnabled()</h4>
</dt>
<dd>
<div class="description">
Returns whether offline mode is currently enabled or not.
</div>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getPageCount"><span class="type-signature"></span>getPageCount()</h4>
</dt>
<dd>
<div class="description">
Returns the number of pages in a document.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The number of the pages in the current document.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">number</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getPageInfo"><span class="type-signature"></span>getPageInfo(pageNumber)</h4>
</dt>
<dd>
<div class="description">
Returns an object containing the width and height of a page.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number of the requested page.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
An object representing the page info. Contains the properties "width" and "height".
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Core.Document.html#.PageInfo">Core.Document.PageInfo</a></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getPageMatrix"><span class="type-signature"></span>getPageMatrix(pageNumber)</h4>
</dt>
<dd>
<div class="description">
Returns an object representing the transformation matrix for the page.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number of the requested page.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
An object representing the page matrix.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getPageRotation"><span class="type-signature"></span>getPageRotation(pageNumber)</h4>
</dt>
<dd>
<div class="description">
Returns the internal degrees of rotation of a page.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number of the requested page.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The internal degrees of rotation of a page. (0, 90, 180 or 270)
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">number</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getPDFCoordinates"><span class="type-signature"></span>getPDFCoordinates(pageNumber, x, y)</h4>
</dt>
<dd>
<div class="description">
Returns an object with the original x and y coordinates converted to PDF coordinates for the page.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number that the coordinates are on</td>
</tr>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The x coordinate</td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The y coordinate</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
An object with the x and y PDF coordinates
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getPDFDoc"><span class="type-signature"></span>getPDFDoc()</h4>
</dt>
<dd>
<div class="description">
Returns the PDFNet.PDFDoc object associated with the document. Note that the full API is required to be enabled
and WebViewer Server cannot be enabled.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise that resolves to the PDFDoc object.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<Core.PDFNet.PDFDoc></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getPrintablePDF"><span class="type-signature"></span>getPrintablePDF()</h4>
</dt>
<dd>
<div class="description">
[PDFTron Server only] Provides a URL to a the PDF with annotations and watermarks merged, and an open action specifying that it should be printed.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Will be null if not supported. Otherwise a promise that resolves to an object with a `url` property pointing to the printable PDF.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
|
<span class="param-type">null</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getTemplateKeys"><span class="type-signature"></span>getTemplateKeys( [format])</h4>
</dt>
<dd>
<div class="description">
[Office Document only] Provides information about the template keys present in the document.
Must have loaded the document with officeOptions.doTemplatePrep, officeOptions.templateValues, or called setTemplatevalues before calling this function.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>format</code></td>
<td class="type">
<span class="param-type">'flat'</span>
|
<span class="param-type">'schema'</span>
|
<span class="param-type">'locations'</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Specifies what type of information to return. Defaults to 'flat'.
'flat' returns a list of all top-level keys used in the document. Keys used in loop bodies are not included in this list, however, this may change in the future.
'schema' returns a detailed <a href="Core.html#.TemplateSchema">schema</a> of the keys used in the document, containing information such as the inferred type of key data.
'locations' returns a collection of the <a href="Core.html#.TemplateBoundingBoxes">bounding boxes</a> of template content in the document
If the template document has been prepped but not filled (officeOptions.doTemplatePrep option has been set), it will return bounding boxes for the template tag text.
If the template document has been filled (applyTemplateValues has been called), it will return bounding boxes for the inserted content.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise that resolves to the requested data.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<(Array.<string>|<a href="Core.html#.TemplateSchema">Core.TemplateSchema</a>|<a href="Core.html#.TemplateBoundingBoxes">Core.TemplateBoundingBoxes</a>)></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getTextByPageAndRect"><span class="type-signature"></span>getTextByPageAndRect(pageNumber, rect)</h4>
</dt>
<dd>
<div class="description">
It returns the text that is within the Rect on the given page
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number that the rect is on</td>
</tr>
<tr>
<td class="name"><code>rect</code></td>
<td class="type">
<span class="param-type"><a href="Core.Math.Rect.html">Core.Math.Rect</a></span>
</td>
<td class="description last">A Rect with x1,y1 representing the top-left and x2,y2 representing the bottom-right</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise that resolves to the extracted text
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<string></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getTextPosition"><span class="type-signature"></span>getTextPosition(pageNumber, textStartIndex, textEndIndex)</h4>
</dt>
<dd>
<div class="description">
Gets quads for each of the characters from start to end index.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number that the text is on.</td>
</tr>
<tr>
<td class="name"><code>textStartIndex</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The position where to start getting character quads from.</td>
</tr>
<tr>
<td class="name"><code>textEndIndex</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The position (up to, but not including) where to finish getting characters.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Resolves with quads, which is an array of objects with (x1,y1,x2,y2,x3,y3,x4,y4)
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<Array.<object>></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getType"><span class="type-signature"></span>getType()</h4>
</dt>
<dd>
<div class="description">
Gets the type of the document.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The type of the document (xod, pdf, office, webviewerServer)
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getViewerCoordinates"><span class="type-signature"></span>getViewerCoordinates(pageNumber, x, y)</h4>
</dt>
<dd>
<div class="description">
Returns an object with the original x and y PDF coordinates converted to Viewer coordinates for the page.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number that the coordinates are on</td>
</tr>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The x coordinate</td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The y coordinate</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
An object with the x and y Viewer coordinates
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getXODCoordinates"><span class="type-signature"></span>getXODCoordinates(pageNumber, x, y)</h4>
</dt>
<dd>
<div class="description">
Returns an object with the original x and y PDF coordinates converted to XOD coordinates for the page.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number that the coordinates are on</td>
</tr>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The x coordinate</td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The y coordinate</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
An object with the x and y XOD coordinates
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="includesThumbnails"><span class="type-signature"></span>includesThumbnails()</h4>
</dt>
<dd>
<div class="description">
Used to know if a document contains thumbnails.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if the document contains thumbnails.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="initOfflineDB"><span class="type-signature"></span>initOfflineDB()</h4>
</dt>
<dd>
<div class="description">
[XOD Document only] Initializes the offline database for use. Must be called before any other offline mode functions are used.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Resolves when offline database is ready for use.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="insertBlankPages"><span class="type-signature"></span>insertBlankPages(insertBeforeThesePages, width, height)</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Inserts blank pages before the given list of pages. Both width and height are in units of PDF points.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>insertBeforeThesePages</code></td>
<td class="type">
<span class="param-type">Array.<number></span>
</td>
<td class="description last">array of page numbers before which to insert blanks</td>
</tr>
<tr>
<td class="name"><code>width</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">width of the blank pages to insert. By default the width is 612 PDF points.</td>
</tr>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">height of the blank pages to insert. By default the height is 792 PDF points.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a promise that resolves to an object with info for any pages inserted
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="insertPages"><span class="type-signature"></span>insertPages(sourceDocument [, pageArray] [, insertBeforeThisPage])</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Inserts a set of pages from the provided Document before a given page number. Note that this method will need to wait for the entire file to be downloaded before the change is applied.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>sourceDocument</code></td>
<td class="type">
<span class="param-type"><a href="Core.Document.html">Core.Document</a></span>
</td>
<td class="attributes">
</td>
<td class="description last">other document from which to take pages (cannot be the same document)</td>
</tr>
<tr>
<td class="name"><code>pageArray</code></td>
<td class="type">
<span class="param-type">Array.<number></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">An optional array of page numbers to extract from the given document. If not passed in, will insert all pages.</td>
</tr>
<tr>
<td class="name"><code>insertBeforeThisPage</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">An optional page number before which to insert the pages. If not passed in, will append to the end.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a promise that resolves to an object describing the updated state of the pages in the document
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="isDownloaded"><span class="type-signature"></span>isDownloaded()</h4>
</dt>
<dd>
<div class="description">
[XOD Document only] Whether the document has already been downloaded for offline mode or not.
</div>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="isLinearized"><span class="type-signature"></span>isLinearized()</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Returns whether the document is linearized or not.
Note that this only works for documents that are loaded by URL and if useDownloader is not set to false.
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Whether the document is linearized or not
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="isWebViewerServerDocument"><span class="type-signature"></span>isWebViewerServerDocument()</h4>
</dt>
<dd>
<div class="description">
Gets whether the document will be interacted with as a WebViewer Server document
This will return false if the document was loaded from WebViewer Server but forceClientSideInit is set to true
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns whether the document will be interacted with as a WebViewer Server document.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="loadAsync"><span class="type-signature"></span>loadAsync(partRetriever, callback, options)</h4>
</dt>
<dd>
<div class="description">
Initialize a Document so that it can be used to load page canvases.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>partRetriever</code></td>
<td class="type">
<span class="param-type"><a href="Core.PartRetrievers.PartRetriever.html">Core.PartRetrievers.PartRetriever</a></span>
</td>
<td class="description last">An instance of PartRetriever.</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="Core.Document.html#.LoadAsyncCallback">Core.Document.LoadAsyncCallback</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
</td>
<td class="description last">an object that can contain the following optional parameters
<h6 class="method-params-label method-subparams-label">Properties</h6>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>workerTransportPromise</code></td>
<td class="type">
<span class="param-type">Promise.<any></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Required to load a PDF or Office file. A promise that will be resolved when a worker transport has been initialized. This can be created by calling Core.initPDFWorkerTransports or Core.initOfficeWorkerTransports as appropriate.</td>
</tr>
<tr>
<td class="name"><code>getPassword</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A method of the form function(callback) where callback is of the form function(password). getPassword will be called when a password is required to load a PDF document and should call the callback with the retrieved password.</td>
</tr>
<tr>
<td class="name"><code>extension</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A field used to specify the type of file being read. This is only relevant for PDF viewing and at the moment only works for certain image formats and .pdf</td>
</tr>
<tr>
<td class="name"><code>customHandlerId</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A field used to specify PDFTron custom security handler. Its value needs to be an integer in [0, 0xFFFFFFFF].</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Resolves when document is initialized, or rejects with error.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="loadCanvas"><span class="type-signature"></span>loadCanvas(options)</h4>
</dt>
<dd>
<div class="description">
Loads a canvas for a particular page number.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">An object specifying the options for loading the canvas. The following parameters should be properties on this object. The only non-optional parameter is pageNumber.
<h6 class="method-params-label method-subparams-label">Properties</h6>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last">The page number of the requested canvas.</td>
</tr>
<tr>
<td class="name"><code>zoom</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The zoom value to render the page at.</td>
</tr>
<tr>
<td class="name"><code>getZoom</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A function that returns the zoom value to render the page at. Use this instead of "zoom" if the value might change in the process of setting up the canvas.</td>
</tr>
<tr>
<td class="name"><code>pageRotation</code></td>
<td class="type">
<span class="param-type"><a href="Core.html#.PageRotation">Core.PageRotation</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The rotation of the page. Valid values are Core.PageRotation.E_0, Core.PageRotation.E_90, Core.PageRotation.E_180, Core.PageRotation.E_270.</td>
</tr>
<tr>
<td class="name"><code>getPageRotation</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A function that returns the rotation of the page. Use this instead of "pageRotation" if the value might change in the process of setting up the canvas.</td>
</tr>
<tr>
<td class="name"><code>finishedLoading</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A callback called after the list of page resources is retrieved. Return true if rendering should continue, false otherwise.</td>
</tr>
<tr>
<td class="name"><code>acquireResources</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A function that returns whether resources need to be acquired or not, defaults to true.</td>
</tr>
<tr>
<td class="name"><code>resourcesLoaded</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A callback called after the page's resources have been loaded. Return true if rendering should continue, false otherwise.</td>
</tr>
<tr>
<td class="name"><code>getPageTransform</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A function that returns the x and y values of the page's translation.</td>
</tr>
<tr>
<td class="name"><code>drawComplete</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The callback to call when the canvas has been completely rendered. The first parameter is a canvas object, and the second parameter is the page number.</td>
</tr>
<tr>
<td class="name"><code>drawProgressive</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The callback to call when the canvas has been partially rendered.</td>
</tr>
<tr>
<td class="name"><code>renderRect</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">An object with x1, y1, x2, y2 properties which is the partial rectangle to render of the entire page. The top left of the page is (0, 0).</td>
</tr>
<tr>
<td class="name"><code>useProgress</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Whether progressive rendering should be used or not.</td>
</tr>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Used to calculate the zoom level if zoom level is not provided. If it's passed the zoom level will be set so the document fits this height. If both width and height are passed the zoom level will be set so the document fits the box delimited by them.</td>
</tr>
<tr>
<td class="name"><code>width</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Used to calculate the zoom level if zoom level is not provided. If it's passed the zoom level will be set so the document fits this width. If both width and height are passed the zoom level will be set so the document fits the box delimited by them.</td>
</tr>
<tr>
<td class="name"><code>multiplier</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The quality of the loaded canvas. Must be a positive number. Higher values are higher quality but take longer to complete and use more memory.</td>
</tr>
<tr>
<td class="name"><code>source</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Indicate the origin of the call. This may be used by the Document's implementation of loadCanvasAsync.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
An id that can be passed to the corresponding Pause, Resume or Cancel functions
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="loadCanvasAsync"><span class="type-signature"></span>loadCanvasAsync(options)</h4>
</dt>
<dd>
<div class="description">
Loads a canvas for a particular page number.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">An object specifying the options for loading the canvas. The following parameters should be properties on this object. The only non-optional parameter is pageNumber.
<h6 class="method-params-label method-subparams-label">Properties</h6>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last">The page number of the requested canvas.</td>
</tr>
<tr>
<td class="name"><code>zoom</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The zoom value to render the page at.</td>
</tr>
<tr>
<td class="name"><code>getZoom</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A function that returns the zoom value to render the page at. Use this instead of "zoom" if the value might change in the process of setting up the canvas.</td>
</tr>
<tr>
<td class="name"><code>pageRotation</code></td>
<td class="type">
<span class="param-type"><a href="Core.html#.PageRotation">Core.PageRotation</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The rotation of the page. Valid values are Core.PageRotation.E_0, Core.PageRotation.E_90, Core.PageRotation.E_180, Core.PageRotation.E_270.</td>
</tr>
<tr>
<td class="name"><code>getPageRotation</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A function that returns the rotation of the page. Use this instead of "pageRotation" if the value might change in the process of setting up the canvas.</td>
</tr>
<tr>
<td class="name"><code>finishedLoading</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A callback called after the list of page resources is retrieved. Return true if rendering should continue, false otherwise.</td>
</tr>
<tr>
<td class="name"><code>acquireResources</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A function that returns whether resources need to be acquired or not, defaults to true.</td>
</tr>
<tr>
<td class="name"><code>resourcesLoaded</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A callback called after the page's resources have been loaded. Return true if rendering should continue, false otherwise.</td>
</tr>
<tr>
<td class="name"><code>getPageTransform</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">A function that returns the x and y values of the page's translation.</td>
</tr>
<tr>
<td class="name"><code>drawComplete</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The callback to call when the canvas has been completely rendered. The first parameter is a canvas object, and the second parameter is the page number.</td>
</tr>
<tr>
<td class="name"><code>drawProgressive</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The callback to call when the canvas has been partially rendered.</td>
</tr>
<tr>
<td class="name"><code>renderRect</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">An object with x1, y1, x2, y2 properties which is the partial rectangle to render of the entire page. The top left of the page is (0, 0).</td>
</tr>
<tr>
<td class="name"><code>useProgress</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Whether progressive rendering should be used or not.</td>
</tr>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Used to calculate the zoom level if zoom level is not provided. If it's passed the zoom level will be set so the document fits this height. If both width and height are passed the zoom level will be set so the document fits the box delimited by them.</td>
</tr>
<tr>
<td class="name"><code>width</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Used to calculate the zoom level if zoom level is not provided. If it's passed the zoom level will be set so the document fits this width. If both width and height are passed the zoom level will be set so the document fits the box delimited by them.</td>
</tr>
<tr>
<td class="name"><code>multiplier</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The quality of the loaded canvas. Must be a positive number. Higher values are higher quality but take longer to complete and use more memory.</td>
</tr>
<tr>
<td class="name"><code>source</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Indicate the origin of the call. This may be used by the Document's implementation of loadCanvasAsync.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="important tag-deprecated method-doc-label method-doc-details-label">Deprecated:</dt>
<dd>
<ul class="dummy">
<li>Since version 8.3. Use <a href="Core.Document.html#loadCanvas">loadCanvas</a> instead.</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
An id that can be passed to the corresponding Pause, Resume or Cancel functions
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="loadPageText"><span class="type-signature"></span>loadPageText(pageNumber)</h4>
</dt>
<dd>
<div class="description">
Gets all the text on the requested page.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number that the text is on.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise that resolves with the page's text.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<string></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="loadThumbnail"><span class="type-signature"></span>loadThumbnail(pageNumber, onLoadThumbnail)</h4>
</dt>
<dd>
<div class="description">
Loads a thumbnail image for a particular page.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number of the requested thumbnail (1-indexed).</td>
</tr>
<tr>
<td class="name"><code>onLoadThumbnail</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">The callback to call when the thumbnail has been retrieved. Accepts an HTMLImageElement or HTMLCanvasElement as a parameter.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The id of the request that can later be used for cancelling the request
It is passed an image element if the .xod file contains thumbnails and a canvas element otherwise.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="loadThumbnailAsync"><span class="type-signature"></span>loadThumbnailAsync(pageNumber, onLoadThumbnail)</h4>
</dt>
<dd>
<div class="description">
Loads a thumbnail image for a particular page.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number of the requested thumbnail (1-indexed).</td>
</tr>
<tr>
<td class="name"><code>onLoadThumbnail</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">The callback to call when the thumbnail has been retrieved. Accepts an HTMLImageElement or HTMLCanvasElement as a parameter.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="important tag-deprecated method-doc-label method-doc-details-label">Deprecated:</dt>
<dd>
<ul class="dummy">
<li>Since version 8.3. Use <a href="Core.Document.html#loadThumbnail">loadThumbnail</a> instead.</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The id of the request that can later be used for cancelling the request
It is passed an image element if the .xod file contains thumbnails and a canvas element otherwise.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="mergeDocument"><span class="type-signature"></span>mergeDocument(source [, position])</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Merge a file into the currently opened document
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>source</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">File</span>
|
<span class="param-type">ArrayBuffer</span>
|
<span class="param-type">Blob</span>
</td>
<td class="attributes">
</td>
<td class="description last">Source parameter, path/url to document or File.</td>
</tr>
<tr>
<td class="name"><code>position</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Optional position for where to merge the document, default to end of file if nothing entered</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a promise that resolves on completion
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<any></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="movePages"><span class="type-signature"></span>movePages(pageArray, insertBeforeThisPage)</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Moves the pages given in an array so they appear in sequence before a given page number. Note that this method will need to wait for the entire file to be downloaded before the change is applied.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageArray</code></td>
<td class="type">
<span class="param-type">Array.<number></span>
</td>
<td class="description last">the page numbers to move</td>
</tr>
<tr>
<td class="name"><code>insertBeforeThisPage</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">page number before which to insert the other pages</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a promise that resolves to an object describing the updated state of the pages in the document
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="off"><span class="type-signature"></span>off( [type] [, fn])</h4>
</dt>
<dd>
<div class="description">
Remove a handler of the given event name
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The name of the event to remove the handler of.
If type is undefined, all the handlers of the object will be removed</td>
</tr>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The handler associated with this event to be removed.
If fn is undefined, all the handlers of the given event name will be removed</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Core.EventHandler.html#off">Core.EventHandler#off</a>
</li>
</ul>
</dd>
<dt class="important tag-deprecated method-doc-label method-doc-details-label">Deprecated:</dt>
<dd>
<ul class="dummy">
<li>Since version 8.0. Use <a href="Core.EventHandler.html#removeEventListener">removeEventListener</a> instead.</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the object that 'off' is being called on
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="sunlight-highlight-javascript">myObject.off();
myObject.off('eventName');
myObject.off('eventName', fn);</pre>
</dd>
<hr>
<dt>
<h4 class="name" id="on"><span class="type-signature"></span>on(type, fn)</h4>
</dt>
<dd>
<div class="description">
Add a handler to the given event name
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">number</span>
</td>
<td class="description last">The name of the event to listen to</td>
</tr>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">The handler to be called when the event is triggered</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Core.EventHandler.html#on">Core.EventHandler#on</a>
</li>
</ul>
</dd>
<dt class="important tag-deprecated method-doc-label method-doc-details-label">Deprecated:</dt>
<dd>
<ul class="dummy">
<li>Since version 8.0. Use <a href="Core.EventHandler.html#addEventListener">addEventListener</a> instead.</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the object that 'on' is being called on
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="sunlight-highlight-javascript">myObject.on('eventName', (eventParameter1, eventParameter2) => {
...
});</pre>
</dd>
<hr>
<dt>
<h4 class="name" id="one"><span class="type-signature"></span>one(type, fn)</h4>
</dt>
<dd>
<div class="description">
Same as 'on' except the handler will be called only once
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">number</span>
</td>
<td class="description last">The name of the event to listen to</td>
</tr>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">The handler to be called when the event is triggered</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Core.EventHandler.html#one">Core.EventHandler#one</a>
</li>
</ul>
</dd>
<dt class="important tag-deprecated method-doc-label method-doc-details-label">Deprecated:</dt>
<dd>
<ul class="dummy">
<li>Since version 8.0. Use <a href="Core.EventHandler.html#addEventListener">addEventListener</a> with {'once': true} as options instead.</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the object that 'one' is being called on
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="sunlight-highlight-javascript">myObject.one('eventName', (eventParameter1, eventParameter2) => {
...
});</pre>
</dd>
<hr>
<dt>
<h4 class="name" id="pauseLoadCanvas"><span class="type-signature"></span>pauseLoadCanvas(id)</h4>
</dt>
<dd>
<div class="description">
Pauses the loadCanvasAsync call corresponding to the passed in id
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The id returned from the loadCanvasAsync call that will be paused.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="refreshTextData"><span class="type-signature"></span>refreshTextData()</h4>
</dt>
<dd>
<div class="description">
Refresh the text data stored by the viewer.
Useful if the text content of the document has changed, e.g. after a redaction.
</div>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="removeEventListener"><span class="type-signature"></span>removeEventListener( [type] [, fn])</h4>
</dt>
<dd>
<div class="description">
Remove a handler of the given event name
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The name of the event to remove the handler of.
If type is undefined, all the handlers of the object will be removed</td>
</tr>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The handler associated with this event to be removed.
If fn is undefined, all the handlers of the given event name will be removed</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Core.EventHandler.html#removeEventListener">Core.EventHandler#removeEventListener</a>
</li>
</ul>
</dd>
<dt class="important tag-deprecated method-doc-label method-doc-details-label">Deprecated:</dt>
<dd>
<ul class="dummy">
<li>for version 9.0. Use [removeEventListener] with fn specified</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the object that 'removeEventListener' is being called on
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="sunlight-highlight-javascript">myObject.removeEventListener();
myObject.removeEventListener('eventName');
myObject.removeEventListener('eventName', fn);</pre>
</dd>
<hr>
<dt>
<h4 class="name" id="removePages"><span class="type-signature"></span>removePages(pageArray)</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Removes the given page numbers. Note that this method will need to wait for the entire file to be downloaded before the change is applied.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageArray</code></td>
<td class="type">
<span class="param-type">Array.<number></span>
</td>
<td class="description last">the page numbers to remove</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a promise that resolves to an object describing the updated state of the pages in the document
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="requirePage"><span class="type-signature"></span>requirePage(pageNumber)</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Ensures that a particular page of the pdf document is finished loading before reading, writing or rendering it.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageNumber</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The page number to ensure completion of loading</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a promise that resolves when the page has been loaded
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<void></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="resumeLoadCanvas"><span class="type-signature"></span>resumeLoadCanvas(id)</h4>
</dt>
<dd>
<div class="description">
Resumes the loadCanvasAsync call corresponding to the passed in id
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The id returned from the loadCanvasAsync call that will be resumed.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="rotatePages"><span class="type-signature"></span>rotatePages(pageArray, rotation)</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Adds the given rotation to the given pages. Note that this method will need to wait for the entire file to be downloaded before the change is applied.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageArray</code></td>
<td class="type">
<span class="param-type">Array.<number></span>
</td>
<td class="description last">an array of the numbers of pages to rotate</td>
</tr>
<tr>
<td class="name"><code>rotation</code></td>
<td class="type">
<span class="param-type"><a href="Core.html#.PageRotation">Core.PageRotation</a></span>
</td>
<td class="description last">the page rotation to add</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a promise that resolves to an object describing the updated state of the pages in the document
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="setLayersArray"><span class="type-signature"></span>setLayersArray(layersContext)</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Update the array describing the layers/OCG structure in order
to adjust which layers should be enabled or disabled.
The layers updated event is triggered as a side effect
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>layersContext</code></td>
<td class="type">
<span class="param-type">Array.<<a href="Core.Document.html#.LayerContext">Core.Document.LayerContext</a>></span>
</td>
<td class="description last">the OCG layers to set</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="setOfflineModeEnabled"><span class="type-signature"></span>setOfflineModeEnabled(enabled)</h4>
</dt>
<dd>
<div class="description">
[XOD Document only] Sets whether offline mode is enabled or not.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enabled</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">The new value for whether offline mode is enabled or not.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="important tag-deprecated method-doc-label method-doc-details-label">Deprecated:</dt>
<dd>
<ul class="dummy">
<li>Since version 8.0. Use <a href="Core.Document.html#enableOfflineMode">enableOfflineMode</a> or <a href="Core.Document.html#disableOfflineMode">disableOfflineMode</a> instead.</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="setOverprintPreviewMode"><span class="type-signature"></span>setOverprintPreviewMode(mode)</h4>
</dt>
<dd>
<div class="description">
[PDF Document only] Set the overprint preview mode to be used when rendering
this document.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>mode</code></td>
<td class="type">
</td>
<td class="description last">The mode to use. Possible values are Core.OverprintPreviewMode.OFF,
Core.OverprintPreviewMode.ON and Core.OverprintPreviewMode.PDFX_ON</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="setTextExtractorProcessingFlags"><span class="type-signature"></span>setTextExtractorProcessingFlags(flags)</h4>
</dt>
<dd>
<div class="description">
Sets the flags with which to extract the text from a PDF document.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>flags</code></td>
<td class="type">
<span class="param-type">Array.<number></span>
</td>
<td class="description last">The flags with which to extract the text from a PDF document. See <a href="Core.html#.TextExtractorProcessingFlags">Core.TextExtractorProcessingFlags</a></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="setWatermark"><span class="type-signature"></span>setWatermark(options)</h4>
</dt>
<dd>
<div class="description">
Sets watermark to be added to the document
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">Object that contains style/content of the watermark</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Example</h5>
<pre class="sunlight-highlight-javascript">doc.setWatermark({
diagonal: {
fontSize: (number),
fontFamily: (string),
color: (string),
opacity: (number (between 0 and 100)),
text: (string)
},
header: {
fontSize: (number),
fontFamily: (string),
color: (string),
opacity: (number (between 0 and 100)),
left: (string),
center: (string),
right: (string)
},
footer: {
fontSize: (number),
fontFamily: (string),
color: (string),
opacity: (number (between 0 and 100)),
left: (string),
center: (string),
right: (string)
}
custom: (function(ctx, pageIndex, pageWidth, pageHeight))
});
To allow more customization of the header/footer, the following can be done:
doc.setWatermark({
diagonal: {
fontSize: (number),
fontFamily: (string),
color: (string),
opacity: (number (between 0 and 100)),
text: (string)
},
headerLeft: {
fontSize: (number),
fontFamily: (string),
color: (string),
opacity: (number (between 0 and 100)),
text: (string)
},
headerCenter: {
fontSize: (number),
fontFamily: (string),
color: (string),
opacity: (number (between 0 and 100)),
text: (string)
},
headerRight: {
fontSize: (number),
fontFamily: (string),
color: (string),
opacity: (number (between 0 and 100)),
text: (string)
},
footerLeft: {
fontSize: (number),
fontFamily: (string),
color: (string),
opacity: (number (between 0 and 100)),
text: (string)
},
footerCenter: {
fontSize: (number),
fontFamily: (string),
color: (string),
opacity: (number (between 0 and 100)),
text: (string)
},
footerRight: {
fontSize: (number),
fontFamily: (string),
color: (string),
opacity: (number (between 0 and 100)),
text: (string)
},
custom: (function(ctx, pageIndex, pageWidth, pageHeight))
});</pre>
</dd>
<hr>
<dt>
<h4 class="name" id="storeOffline"><span class="type-signature"></span>storeOffline(onComplete, onProgress)</h4>
</dt>
<dd>
<div class="description">
[XOD Document only] Downloads the document for offline viewing.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onComplete</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">The function that's called when the document has finished being downloaded or the download has been cancelled</td>
</tr>
<tr>
<td class="name"><code>onProgress</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">The function that's called on each update in progress of the download.
The fraction downloaded is passed as a parameter. (eg 50% downloaded passes 0.5)</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="trigger"><span class="type-signature"></span>trigger(type [, data])</h4>
</dt>
<dd>
<div class="description">
Calls the handlers of the event name with given data
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last">event name of which the handlers will be called.</td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">data that will be passed to the handlers.
If data is an array, it will be spread and then passed to the handlers</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Core.EventHandler.html#trigger">Core.EventHandler#trigger</a>
</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the object that 'trigger' is being called on
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="sunlight-highlight-javascript">myObject.trigger('eventName');
myObject.trigger('eventName', [eventParameter1, eventParameter2]);</pre>
</dd>
<hr>
<dt>
<h4 class="name" id="unloadCanvasResources"><span class="type-signature"></span>unloadCanvasResources(id)</h4>
</dt>
<dd>
<div class="description">
Unloads resources for the page associated with the loadCanvasAsync call corresponding to the passed in id.
So if the loadCanvasAsync call had requested page 2 then page 2's resources will be cleaned up
(as long as nothing else requires those resources). Note that the canvas element itself is not touched.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The id returned from the loadCanvasAsync call that will have it's page resources unloaded</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="unloadResources"><span class="type-signature"></span>unloadResources()</h4>
</dt>
<dd>
<div class="description">
Cleans up the resources associated with the document.
</div>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="updateRasterizerOptions"><span class="type-signature"></span>updateRasterizerOptions(options)</h4>
</dt>
<dd>
<div class="description">
Update rasterizer options of the document
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Options for this function
<h6 class="method-params-label method-subparams-label">Properties</h6>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>pageTransparent</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">Page background transparency.</td>
</tr>
<tr>
<td class="name"><code>overprintMode</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
Core.OverprintPreviewMode.PDFX_ON
</td>
<td class="description last">Enable or disable support for overprint and overprint simulation.</td>
</tr>
<tr>
<td class="name"><code>antiAliasing</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
true
</td>
<td class="description last">Enable or disable anti-aliasing.</td>
</tr>
<tr>
<td class="name"><code>pathHinting</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
true
</td>
<td class="description last">Enable or disable path hinting.</td>
</tr>
<tr>
<td class="name"><code>thinLinePixelGridFit</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">If true (horizontal/vertical) thin lines will be snapped to integer pixel positions.</td>
</tr>
<tr>
<td class="name"><code>thinLineStrokeAdjust</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
true
</td>
<td class="description last">Enable or disable auto stroke adjustment.</td>
</tr>
<tr>
<td class="name"><code>imageSmoothing</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
true
</td>
<td class="description last">Enable or disable image smoothing.</td>
</tr>
<tr>
<td class="name"><code>hqImageResampling</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">Whether use a higher quality (but slower) smoothing algorithm.</td>
</tr>
<tr>
<td class="name"><code>caching</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
true
</td>
<td class="description last">Enables or disables caching. Caching can improve the rendering performance in cases where the same page will be drawn multiple times.</td>
</tr>
<tr>
<td class="name"><code>expGamma</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
-1.0
</td>
<td class="description last">The gamma factor used for anti-aliased rendering. It is the exponent value of gamma function. Typical values are in the range from 0.1 to 3.</td>
</tr>
<tr>
<td class="name"><code>colorPostProcessMode</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
Core.ColorPostProcessMode.NONE
</td>
<td class="description last">Set the color post processing transformation. This transform is applied to the rasterized bitmap as the final step in the rasterization process, and is applied directly to the resulting bitmap (disregarding any color space information). Note that this option has no effect when using Core.OverprintPreviewMode.SEPARATION_RENDER.</td>
</tr>
<tr>
<td class="name"><code>renderAnnots</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">Enable or disable annotation and forms rendering (In the viewer, annotation rendering is done separately).</td>
</tr>
<tr>
<td class="name"><code>highlightFields</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">Enable or disable highlighting form fields. This option only has an effect when renderAnnots is true.</td>
</tr>
<tr>
<td class="name"><code>isPrinting</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">Tells the rasterizer to render the page 'print' mode. Certain page elements (such as annotations or OCG-s) are meant to be visible either on the screen or on the printed paper but not both. A common example, is the "Submit" button on electronic forms.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
returns true if document can update rasterizer options
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<dl>
<hr>
<dt class="name" id=".LayerContext">
<h4 id=".LayerContext">LayerContext</h4>
</dt>
<dd>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>obj</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the unique identifier of the layer. This is not defined if the layer is a label</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the name of the layer. It does not have not be unique</td>
</tr>
<tr>
<td class="name"><code>locked</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">boolean to denote if the layer is locked for viewing. This state cannot be toggled by the user through the user interface</td>
</tr>
<tr>
<td class="name"><code>visible</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">boolean to denote if the layer is visible</td>
</tr>
<tr>
<td class="name"><code>children</code></td>
<td class="type">
<span class="param-type">Array.<<a href="Core.Document.html#.LayerContext">Core.Document.LayerContext</a>></span>
</td>
<td class="description last">the layer's children (if any). This is not defined if the layer is a label.</td>
</tr>
</tbody>
</table>
</dl>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id=".LoadAsyncCallback"><span class="type-signature"></span>LoadAsyncCallback( [error])</h4>
</dt>
<dd>
<div class="description">
The callback to call when the Document has been initialized. If there is an error then an error object will be passed to the callback function.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The error that occurs when initializing the document</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt class="name" id=".PageInfo">
<h4 id=".PageInfo">PageInfo</h4>
</dt>
<dd>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>width</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The width of the page</td>
</tr>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The height of the page</td>
</tr>
</tbody>
</table>
</dl>
</dl>
</dd>
<hr>
<dt class="name" id=".XFDFInfo">
<h4 id=".XFDFInfo">XFDFInfo</h4>
</dt>
<dd>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>xfdfString</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The XFDF string</td>
</tr>
<tr>
<td class="name"><code>pages</code></td>
<td class="type">
<span class="param-type">Array.<number></span>
</td>
<td class="description last">Array of page numbers that annotations were extracted from</td>
</tr>
</tbody>
</table>
</dl>
</dl>
</dd>
</dl>
<h3 class="subsection-title">Events</h3>
<dl>
<hr>
<dt>
<h4 class="name" id="event:colorSeparationAdded">colorSeparationAdded</h4>
</dt>
<dd>
<div class="description">
Triggered when a color separation is loaded and available on the document.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>colorData</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">An object with properties of the color separation
<h6 class="method-params-label method-subparams-label">Properties</h6>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The name of the color separation</td>
</tr>
<tr>
<td class="name"><code>rgb</code></td>
<td class="type">
<span class="param-type">Array.<any></span>
</td>
<td class="description last">An array containing the R, G and B values for the separation</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:layersUpdated">layersUpdated</h4>
</dt>
<dd>
<div class="description">
Triggered when a document's layers/OCG structures change visibility.
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>layerContext</code></td>
<td class="type">
<span class="param-type">Array.<<a href="Core.Document.html#.LayerContext">Core.Document.LayerContext</a>></span>
</td>
<td class="description last">array of page layers</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
</dl>
</article>
</section>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-3">
<div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
</div>
</div>
</div>
<div class="modal fade" id="searchResults">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Search results</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<footer>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a>
on 2023-06-16T14:56:46-07:00
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>
<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );
$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
var $this = $( this );
var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
lang = langClassMatch ? langClassMatch[1] : "javascript";
}
if ( lang ) {
$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );
}
} );
Sunlight.highlightAll( {
lineNumbers : false,
showMenu : true,
enableDoclinks : true
} );
$.catchAnchorLinks( {
navbarOffset: 10
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
showAndHide : false,
smoothScrolling: true
} );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
$( "table" ).each( function () {
var $this = $( this );
$this.addClass('table');
} );
} );
</script>
<!--Navigation and Symbol Display-->
<!--Google Analytics-->
<script type="text/javascript">
$(document).ready(function() {
SearcherDisplay.init();
});
</script>
</body>
</html>