Search results

Migration from Essential JS 1 in JavaScript (ES5) PDF Viewer control

This article describes API migration process of PDF Viewer component from Essential JS 1 to Essential JS 2.

Properties

Behavior API in Essential JS 1 API in Essential JS 2
Localization Property: locale
$("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', locale:"es-ES" });
Property: locale
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer');
To set the PDF document path for initial loading Property: documentPath
$("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', documentPath: "HTTP Succinctly.pdf" });
Property: documentPath
var pdfviewer = new ej.pdfviewer.PdfViewer({ documentPath: "PDF_Succinctly.pdf", serviceUrl:'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
To get the number of the page being displayed in the PDF Viewer Property: currentPageNumber
$var pdfviewerObj = $("#viewer").data("ejPdfViewer");var currentPage = pdfviewerObj.currentPageNumber;
Property: currentPageNumber
var pdfviewerObj = document.getElementById("PdfViewer").ej2_instances[0];var currentPage = pdfviewerObj.currentPageNumber;
Enables or disables the hyperlinks in PDF document Property: enableHyperlink
var pdfviewerObj =$("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', enableHyperlink: false });
Property: enableHyperlink
var pdfviewer = new ej.pdfviewer.PdfViewer({serviceUrl:'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',enableHyperlink: false});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Enables or disables the text selection in PDF document Property: enableTextSelection
$var pdfviewerObj = $("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', enableTextSelection: false });
Property: enableTextSelection
var pdfviewer = new ej.pdfviewer.PdfViewer({serviceUrl:'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',enableTextSelection: false});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
To get the name of the PDF document loaded in PDF Viewer Property: fileName
var pdfviewerObj = $("#viewer").data("ejPdfViewer"); var fileName = pdfviewerObj.fileName;
Property: fileName
var pdfviewerObj = document.getElementById("PdfViewer").ej2_instances[0]; var currentPage = pdfviewerObj.fileName;
Specifies the open state of hyperlink in the PDF document Property: hyperlinkOpenState
$("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', hyperlinkOpenState : ej.PdfViewer.LinkTarget.NewTab});
Property: hyperlinkOpenState
var pdfviewer = new ej.pdfviewer.PdfViewer({serviceUrl:'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',hyperlinkOpenState :"NewTab",});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Checks whether the PDF document is edited Property: isDocumentEdited
var pdfviewerObj = $("#viewer").data("ejPdfViewer");var isEdited = pdfviewerObj.isDocumentEdited;
Property: isDocumentEdited
var pdfviewerObj = document.getElementById("PdfViewer").ej2_instances[0]; var isDocumentEdited = pdfviewerObj.isDocumentEdited;
Gets the total number of pages in PDF document Property: pageCount
var pdfviewerObj = $("#viewer").data("ejPdfViewer");var pageCount = pdfviewerObj.pageCount;
Property: pageCount
var pdfviewerObj = document.getElementById("PdfViewer").ej2_instances[0]; var pageCount = pdfviewerObj.pageCount;
Sets the PDF Web API service URL Property: serviceUrl
$("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', documentPath: "HTTP Succinctly.pdf" });
Property: serviceUrl
var pdfviewer = new ej.pdfviewer.PdfViewer({serviceUrl:'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Specifies the viewer interaction mode Property: interactionMode
$("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', interactionMode: ej.PdfViewer.InteractionMode.Pan})
Property: interactionMode
var pdfviewer = new ej.pdfviewer.PdfViewer({serviceUrl:'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',interactionMode:"Pan"});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Gets the current zoom percentage of the PDF document in viewer Property: zoomPercentage
var pdfviewerObj = $("#viewer").data("ejPdfViewer");var zoomPercentage = pdfviewerObj.zoomPercentage;
Property: zoomPercentage
var pdfviewerObj = document.getElementById("PdfViewer").ej2_instances[0]; var zoomPercentage = pdfviewerObj.zoomPercentage;
Specifies the name of the action method in the server Property: serverActionSettings
$("#viewer").ejPdfViewer ({ServiceUrl:'../api/PdfViewer', serverActionSettings: { load: "Load", fileUpload: "FileUpload", print: "Print", download: "Download" } });});
Property: serverActionSettings
var pdfviewer = new ej.pdfviewer.PdfViewer({serviceUrl:'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',serverActionSettings: {load:'Upload', renderPages:'RenderPdfPages', renderComments:'RenderAnnotationComments', renderThumbnail:'RenderThumbnailImages' , unload:'Unload', print:'PrintImages', download:'Donwload' },});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Defines the settings of the PdfViewer toolbar Property: toolbarSettings
$("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', toolbarSettings: { showTooltip: false } });
Property: toolbarSettings
var pdfviewer = new ej.pdfviewer.PdfViewer({serviceUrl:'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer', toolbarSettings: { showTooltip : true, toolbarItem: ['OpenOption']}});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Gets/sets the settings of the highlight annotation Property: highlightSettings
$("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', highlightSettings: {color: "#ffff00", author: "Guest", opacity: 0.5, subject: "highlight", modifiedDate: "2017-03-27 12:00:51", isLocked: true} });
Property: highlightSettings
var pdfviewer = new ej.pdfviewer.PdfViewer({serviceUrl:'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer', highlightSettings: {author: 'Guest User', subject: 'Important', color: '#ffff00', opacity: 0.9, modifiedDate: ''},});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Gets/sets the settings of the underline annotation Property: underlineSettings
$("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', underlineSettings: {color: "#ffff00", author: "Guest", opacity: 0.5, subject: "highlight", modifiedDate: "2017-03-27 12:00:51", isLocked: true} });
Property: underlineSettings
var pdfviewer = new ej.pdfviewer.PdfViewer({serviceUrl:'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer', underlineSettings: {author: 'Guest User', subject: 'Important', color: '#ffff00', opacity: 0.9, modifiedDate: ''},});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Gets/sets the settings of the strikethrough annotation Property: strikethroughSettings
$("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', strikethroughSettings: {color: "#ffff00", author: "Guest", opacity: 0.5, subject: "highlight", modifiedDate: "2017-03-27 12:00:51", isLocked: true} });
Property: strikethroughSettings
var pdfviewer = new ej.pdfviewer.PdfViewer({serviceUrl:'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer', strikethroughSettings: {author: 'Guest User', subject: 'Important', color: '#ffff00', opacity: 0.9, modifiedDate: ''},});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');

Methods

Behavior API in Essential JS 1 API in Essential JS 2
Downloads the PDF document being loaded in the ejPdfViewer control Property: download()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.download();
Property: download()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.download();
Scales the page to fit the page in the container in the control Property: fitToPage()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.fitToPage();
Property: fitToPage()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.magnification.fitToPage();
Scales the page to fit the page width to the width of the container in the control Property: fitToWidth()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.fitToWidth();
Property: fitToWidth()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.magnification.fitToWidth();
Magnifies the page to the next value in the zoom drop down list Property: zoomIn()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.zoomIn();
Property: zoomIn()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.magnification.zoomIn();
Shrinks the page to the previous value in the magnification in the drop down list Property: zoomOut()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.zoomOut();
Property: zoomOut()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.magnification.zoomOut();
Shrinks the page to the previous value in the magnification in the drop down list Property: zoomTo(zoomValue)
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.zoomTo(130);
Property: zoomTo(zoomValue)
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.magnification.zoomTo("130");
Navigates to the first page of PDF document Property: goToFirstPage()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.goToFirstPage();
Property: goToFirstPage()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.navigation.goToFirstPage();
Navigates to the next page of PDF document Property: goToNextPage()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.goToNextPage();
Property: goToNextPage()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.navigation.goToNextPage();
Navigates to the previous page of PDF document Property: goToPreviousPage()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.goToPreviousPage();
Property: goToPreviousPage()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.navigation.goToPreviousPage();
Navigates to the last page of PDF document Property: goToLastPage()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.goToLastPage();
Property: goToLastPage()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.navigation.goToLastPage();
Navigates to the specific page in the PDF document Property: goToPage(pageNumber)
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.goToPage(3);
Property: goToPage(pageNumber)
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.navigation.goToPage(3);
Loads the document and displays it in PDF Viewer Property: load(fileName)
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.load("Manual");
Property: load(fileName, password)
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.load("Manual",null);
Searches the target text in the PDF document and highlights the occurrences in the pages Property: searchText(targetText)
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.searchText("name");
Property: searchText(searchText,isMatchCase)
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.textSearch.searchText("name", true);
Searches the next occurrence of the searched text from the current occurrence in the PDF Viewer control Property: searchNext()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.searchNext();
Property: searchNext()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.textSearch.searchNext();
Searches the previous occurrence of the searched text from the current occurrence in the PDF viewer control Property: searchPrevious()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.searchPrevious();
Property: searchPrevious()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.textSearch.searchPrevious();
Cancels the text search and removes the highlighted occurrences from the PDF Viewer Property: cancelSearchText()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.cancelSearchText();
Property: cancelSearchText()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.textSearch.cancelSearchText();
Prints the PDF document Property: print()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.print();
Property: print()
var pdfviewer = new ej.pdfviewer.PdfViewer({locale: 'es-ES', serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');pdfviewer.print.print();
Performs redo function for the included annotations in the PDF document Property: redo()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.redo();
Property: redo()
var pdfviewerObj = document.getElementById("PdfViewer").ej2_instances[0]; pdfviewerObj.annotation.redo();
Performs undo function for the included annotations in the PDF document Property: undo()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.undo();
Property: undo()
var pdfviewerObj = document.getElementById("PdfViewer").ej2_instances[0]; pdfviewerObj.annotation.undo();
Unloads the PDF document being displayed in the PDF viewer Property: unload()
var pdfviewerObj = $("#viewer").data("ejPdfViewer");pdfviewerObj.unload();
Property: unload()
var pdfviewerObj = document.getElementById("PdfViewer").ej2_instances[0]; pdfviewerObj.unload();

Events

Behavior API in Essential JS 1 API in Essential JS 2
Triggers when the PDF document gets loaded and is ready to view in the Control Property: documentLoad
$(function () {var obj = $("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', documentLoad:"documentLoaded" });});function documentLoaded(args) {alert("The document" +args.fileName + "is ready to view");}
Property: documentLoad
var pdfviewer = new ej.pdfviewer.PdfViewer({ serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',documentLoad: function () {alert("The PDF document is Loaded")}}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Triggers when hyperlink in the PDF document is clicked Property: hyperlinkClick
$(function () {var obj = $("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', hyperlinkClick:"onHyperlinkClicked" });});function onHyperlinkClicked(args) {alert(""The hyperlink is " + args.hyperlink");}
Property: hyperlinkClick
var pdfviewer = new ej.pdfviewer.PdfViewer({ serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',hyperlinkClick: function () {alert("The hyperlink is clicked")}}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Triggers when there is a change in current page number Property: pageChange
$(function () {var obj = $("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer',pageChange:"currentPageChanged" });});function currentPageChanged(args) {alert("The current page number is " + args.currentPageNumber);}
Property: pageChange
var pdfviewer = new ej.pdfviewer.PdfViewer({ serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',pageChange: function () {alert("Current page is changed")}}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Triggers when the mouse click is performed over the page of the PDF document Property: pageClick
$(function () {var obj = $("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', pageClick: "onPageClicked" });});function onPageClicked(args) { alert("X-coordinate :" + args.XCoordinate + " Y-coordinate :" + args.YCoordinate);}
Property: pageClick
var pdfviewer = new ej.pdfviewer.PdfViewer({ serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',pageClick: function () {alert("Page is clicked")}}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Triggers when there is a change in the magnification value Property: zoomChange
$(function () {var obj = $("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', zoomChange: "zoomChanged" });});function onPageClicked(args) { alert("The magnification changes from " + args.previousZoomPercentage + " to" + args.currentZoomPercentage);}
Property: zoomChange
var pdfviewer = new ej.pdfviewer.PdfViewer({ serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',zoomChange: function () {alert("Zoom Value is changed")}}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Triggers when an annotation is added over the page of the PDF document Property: annotationAdd
$(function () {var obj = $("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', annotationAdd: "annotationAdd" });});function annotationAdd(args) { alert("The annotation is added to the PDF document successfully");}
Property: annotationAdd
var pdfviewer = new ej.pdfviewer.PdfViewer({ serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',annotationAdd: function () { alert("The annotation is added to the PDF document successfully")}}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Triggers when an annotation is removed from the page of the PDF document Property: annotationRemove
$(function () {var obj = $("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', annotationRemove: "annotationRemove" });});function annotationRemove(args) {alert("The annotation is removed from the PDF document successfully");}
Property: annotationRemove
var pdfviewer = new ej.pdfviewer.PdfViewer({ serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',annotationRemove: function () {alert("The annotation is removed from the PDF document successfully")}}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');
Triggers when the property of the annotation is changed in the page of the PDF document Property: annotationPropertiesChange
$(function () {var obj = $("#viewer").ejPdfViewer({ serviceUrl: '../api/PdfViewer', annotationPropertiesChange: "annotationPropertiesChange" });});function annotationPropertiesChange(args) {alert("The annotation property is changed successfully");}
Property: annotationPropertiesChange
var pdfviewer = new ej.pdfviewer.PdfViewer({ serviceUrl:https://ej2services.syncfusion.com/production/web-services/api/pdfviewer',annotationPropertiesChange: function () {alert("The annotation property is changed successfully")}}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch,ej.pdfviewer.Navigation,ej.pdfviewer.Print);pdfviewer.appendTo('#PdfViewer');