How can I help you?
Display custom items in the custom stamp dropdown
23 Oct 20252 minutes to read
The PDF Viewer supports custom stamp templates so that reviewers can reuse organization-specific seals or approval marks. Populate the custom stamp dropdown by configuring the PdfViewerCustomStampSettings object when initializing the viewer.
Follow these steps to surface custom stamp items:
Step 1: Create an ASP.NET MVC PDF Viewer sample by following the getting started guide. The tutorial explains how to reference the required Syncfusion scripts, styles, and Razor Page model before adding custom stamps.
Step 2: Define the custom stamp collection in the Razor Page and assign it to PdfViewerCustomStampSettings. The sample below demonstrates how to add base64 or hosted image sources to the dropdown. Replace the placeholder image strings with production-ready assets that your application can access securely.
@using Syncfusion.EJ2.PdfViewer
@{
ViewBag.Title = "Home Page";
}
@{
ViewData["Title"] = "Home page";
List<Object> customStamp = new List<Object>();
customStamp.Add(new
{
customStampName = "Image1",
customStampImageSource="data:image/png;base64,...' // Provide a valid base64 or URL for the image"
});
customStamp.Add(new
{
customStampName = "Image2",
customStampImageSource ="data:image/png;base64,...' // Provide a valid base64 or URL for the image"
});
PdfViewerCustomStampSettings CustomStampsSettings = new PdfViewerCustomStampSettings()
{
IsAddToMenu = true,
CustomStamps = customStamp,
EnableCustomStamp = true,
Opacity = 1,
};
}
<div>
<div style="height:500px;width:100%;">
@Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").CustomStampSettings(CustomStampsSettings).Render()
</div>
</div>After configuring the custom stamp settings, the viewer automatically lists the provided stamp items in the custom stamp dropdown so users can insert them directly onto PDF pages.