Skip to content

905903: Updated sample for Customize existing toolbar both standalone and Server-Backed #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions How to/Customize existing toolbar/PDFViewerSample.csproj

This file was deleted.

51 changes: 0 additions & 51 deletions How to/Customize existing toolbar/Pages/Shared/_Layout.cshtml

This file was deleted.

26 changes: 0 additions & 26 deletions How to/Customize existing toolbar/README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
VisualStudioVersion = 17.10.34607.79
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDFViewerSample", "PDFViewerSample.csproj", "{39AA1883-BB43-4C46-9892-6033EA59C990}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolbarCustomization", "ToolbarCustomization\ToolbarCustomization.csproj", "{A03771AD-04BE-4843-8FF8-BCBC1FA49EDD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{39AA1883-BB43-4C46-9892-6033EA59C990}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39AA1883-BB43-4C46-9892-6033EA59C990}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39AA1883-BB43-4C46-9892-6033EA59C990}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39AA1883-BB43-4C46-9892-6033EA59C990}.Release|Any CPU.Build.0 = Release|Any CPU
{A03771AD-04BE-4843-8FF8-BCBC1FA49EDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A03771AD-04BE-4843-8FF8-BCBC1FA49EDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A03771AD-04BE-4843-8FF8-BCBC1FA49EDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A03771AD-04BE-4843-8FF8-BCBC1FA49EDD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5F13CE16-9CC4-4755-AFB4-367F461A209C}
SolutionGuid = {31245B35-82FC-4C3B-A888-4730D0AD8EE0}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ public void OnGet()
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@page "{handler?}"
@model IndexModel
@using Syncfusion.EJ2.PdfViewer
@using Newtonsoft.Json
@{
ViewData["Title"] = "Home page";
CustomToolbarItems customToolbarItems = new CustomToolbarItems();
var toolItem1 = new { id = "submit_form", text = "Submit Form", tooltipText = "Custom toolbar item", align = "Center", cssClass = "custom_button" };
customToolbarItems.ToolbarItems = new List<object> { toolItem1, "OpenOption", "PageNavigationTool", "MagnificationTool", "PanTool", "SelectionTool", "SearchOption", "PrintOption", "DownloadOption", "UndoRedoTool", "AnnotationEditTool", "FormDesignerEditTool", "CommentTool" };
PdfViewerToolbarSettings toolbarSettings = new PdfViewerToolbarSettings()
{
ShowTooltip = true,
ToolbarItems = customToolbarItems.ToolbarItems
};
}

<br>
<br>
<div>
<ejs-pdfviewer id="pdfviewer" style="height:600px"
serviceUrl="/Index"
documentPath="https://cdn.syncfusion.com/content/pdf/form-designer.pdf"
toolbarClick="toolbarClick"
ToolbarSettings="toolbarSettings">

</ejs-pdfviewer>
</div>

<script>
function toolbarClick(args) {
var viewer = document.getElementById('pdfviewer').ej2_instances[0];
if (args.item && args.item.id === 'submit_form') {
alert('Custom button clicked!');
}
}
</script>

<style>
.custom_button {
height: 100% !important;
}
</style>
Loading