I want to disable Open Button in FileToggleButton but can't find the name of template of it, can anybody help me?
Hi Nguyen,
We can disable open tool menu’s visibility using the below code and sample attached below.
|
//Get the instance of the toolbar using its template name. DocumentToolbar toolbar = pdfViewer.Template.FindName("PART_Toolbar", pdfViewer) as DocumentToolbar; //Get the instance of the file menu button using its template name. ToggleButton FileButton = (ToggleButton)toolbar.Template.FindName("PART_FileToggleButton", toolbar); //Get the instance of the file menu button context menu and the item collection. ContextMenu FileContextMenu = FileButton.ContextMenu; foreach (MenuItem FileMenuItem in FileContextMenu.Items) { //Get the instance of the open menu item using its template name and disable its visibility. if (FileMenuItem.Name == "PART_OpenMenuItem") FileMenuItem.Visibility = System.Windows.Visibility.Collapsed; } |
UG link: https://help.syncfusion.com/wpf/pdf-viewer/how-to/disable-toolbar-items
Regards,
Krithika
Thank u, and another problem is that i want to make custom [Print], [Page Navigation], [Zoom] and [Find] button. I have found out how to make [Print] button but the rest have no information, can you help me?
On analyzing your requirement, we suspect that your requirement is to create a custom toolbar with your own functionalities. To achieve your requirement, we have created a custom toolbar sample with custom buttons and attached below for your reference. If you want to change the functionality of any custom button, you can modify it in their respective click events in the sample.
I am using UserControl, not Windows to apply your code, could you provide me a version when use UserControl?
According to your specifications, we have created a customized toolbar sample using the UserControl. In this sample, we have included the code for customizing the Pdfviewer toolbar design within a UserControl. Please refer the attached sample for your reference.
If i want to using binding command in code behind is it possible?
As per your specifications, we are able to utilize API calls instead of binding commands. Consequently, we have made adjustments to the customized toolbar sample. In this sample, we have eliminated the code for binding commands in XAML and instead, we have utilized click events and called the corresponding APIs. For your convenience, please refer to the attached sample.
I have facing another problem is that when click print button on the toolbar of pdfviewer, it will show setting before print like this:
But when i run your code it only printing, not allow setting, can you help me?
Previously, we have provided the default silent printing API for the print button in the PdfViewer. In WPF PdfViewer control, we can display the print dialog box by passing the Boolean value true in the parameter of the Print API. We have modified the sample as per your requirement and attached below with code snippet.
|
pdfViewer.Print(true); |
Hi, i'm trying to create new thread but it unable, i'm facing problem that when i add signature to pdf file and save it, then i open it in pdfviewer again but it didn't show the signature while other editor can show it. Can you explain about it?
Please let us know the exact way of adding Signature to the PDF file to reproduce the reported issue on our end. Also, we suspect that the reported issue might be document specific.
We have an NDA (Non-Disclosure Agreement) in place with our customers and we maintain the confidentiality of the information disclosed by our customers to us. Therefore, any documents shared with Syncfusion will only be used to replicate the issue and will not be shared with anyone else. So kindly share the original input document or share the input document after removing confidential information.
I have use add signature button in toolbar, after add, it showed on the pdfViewer, but after open again, it not show even though that pdfviewer of devexpress have show it
Devexpress pdfviewer:
Sf Pdfviewer:
Here is the sample you give me before, i try to open the after edit file but it the same result as my code, i have put two file (original and edited) into Assets folder. Hope you guys can response soon because it's an urgent task for my client.
We were unable to reproduce the reported issue with the provided details. Below, we have attached a sample and a video demonstrating our attempt to replicate the issue on our end. If the problem persists on your end, kindly modify the provided sample and share it with us. This will greatly assist us in conducting further investigation.
Below is the video i tested, after save if i open again, the signature will disappear in sf pdfviewer why i can see it in devexpress pdfviewer and WPS application.
We have created a new ticket under your account to follow up with this query. We suggest you to follow up with the ticket for further updates. Please login using the below link.