We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Pdf viewer ToolbarItems

Thread ID:

Created:

Updated:

Platform:

Replies:

143346 Mar 15,2019 06:53 AM UTC Mar 15,2019 12:22 PM UTC Angular - EJ 2 1
loading
Tags: PDF Viewer
jeosebastian
Asked On March 15, 2019 06:53 AM UTC

Hi,
     We are trying to implement pdf viewer to our application and we want to disable right click from the viewer. Somebody please help me out to do that. Also disabling the download and print option from viewer.

Akshaya Arivoli [Syncfusion]
Replied On March 15, 2019 12:22 PM UTC

Hi Jeosebastian 
 
Greetings from Syncfusion, 
 
In our EJ2 PDF Viewer right click will be enabled only the text content in the PDF document is selected. We can disable the text selection by setting false to enableTextSelection
  
The toolbar settings of the PDF Viewer can be set using the toolbarSettings API during control initialization and it contains the following properties: 
  
ShowTooltip: Shows or hides the tooltip of the toolbar items. 
ToolbarItem: Shows or hides the toolbar items in the PDF Viewer toolbar. 
  
Refer to the following to remove print and download icons in toolbar 
HTML: 
<div class="content-wrapper">  
  <ejs-pdfviewer id="pdfViewer" [serviceUrl]='service' [documentPath]='document'  [toolbarSettings]= 'toolbarSettings'  style="height:850px;display:block"></ejs-pdfviewer> 
</div> 
  
TS 
export class AppComponent implements OnInit { 
    public service = 'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer'; 
    public document = 'PDF_Succinctly.pdf';            
              public toolbarSettings = { toolbarItem: 'OpenOption,PageNavigationTool, MagnificationTool, PanTool, SelectionTool, SearchOption'}; 
    ngOnInit(): void {          
  
We have created the sample for the same and shared in the following location, 
  
You can hide the toolbar items form the PDF Viewer toolbar dynamically using the showToolbarItem method. The list of available toolbar items is identified using the ToolbarItem property. Refer to the following code to hide the Open icon from the PDF Viewer toolbar.  
  
window.onload = function () { 
        var pdfViewer = document.getElementById('pdfviewer').ej2_instances[0]; 
        pdfViewer.toolbar.showToolbarItem(new Array("OpenOption"), false); 
    } 
  
Please try this and revert us with more details about your requirement if you have any concerns on this. 
 
 
Regards, 
Akshaya 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon