Adding a Custom Stamp to a PDF Using Xamarin PDF Viewer | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (180).NET Core  (28).NET MAUI  (227)Angular  (113)ASP.NET  (49)ASP.NET Core  (81)ASP.NET MVC  (87)Azure  (42)Black Friday Deal  (1)Blazor  (236)BoldSign  (14)DocIO  (24)Essential JS 2  (111)Essential Studio  (200)File Formats  (72)Flutter  (136)JavaScript  (226)Microsoft  (122)PDF  (83)Python  (1)React  (105)Streamlit  (1)Succinctly series  (131)Syncfusion  (964)TypeScript  (33)Uno Platform  (3)UWP  (3)Vue  (46)Webinar  (53)Windows Forms  (59)WinUI  (72)WPF  (163)Xamarin  (159)XlsIO  (38)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (11)Business intelligence  (55)Button  (4)C#  (164)Chart  (147)Chart of the week  (58)Cloud  (15)Company  (440)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (73)Development  (681)Doc  (7)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (7)Essential Tools  (13)Excel  (43)Extensions  (23)File Manager  (7)Gantt  (21)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (522)Mobile MVC  (9)OLAP server  (2)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (45)Performance  (13)PHP  (2)PivotGrid  (5)Predictive Analytics  (6)Report Server  (3)Reporting  (8)Reporting / Back Office  (9)Rich Text Editor  (12)Road Map  (12)Scheduler  (54)Security  (5)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (32)Solution Services  (4)Spreadsheet  (11)SQL  (15)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (113)UI  (406)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (628)What's new  (341)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Adding a Custom Stamp to a PDF Using Xamarin PDF Viewer

Adding a Custom Stamp to a PDF Using Xamarin PDF Viewer

What is a custom stamp?

A custom stamp is a user-defined virtual rubber stamp that allows users to add their own customized, personal signatures or seals to a PDF document. For example, this can be used for marking up an invoice in the received, approved, or expired stages of a process. It also can be used to add an approval (or other) stage with name, date, and time information.


The custom stamp annotation feature in PDF Viewer allows users to include any form of Xamarin.Forms widget, such as Button, Entry, Label, or Image, anywhere in a PDF document. You can perform operations such as add, move, resize, and delete on custom stamp annotations. Also, you can save and load the existing custom stamp annotations associated with a PDF document in the PDF Viewer control.

In this blog, we are going to see two typical examples of custom stamps used in the real world:

Adding an image as a custom stamp

PDF Viewer provides an option to add any user-defined or customized image as a custom stamp to the PDF document. The AddStamp method in PDF Viewer is used to achieve this. The following code example demonstrates how to add an image as a custom stamp.

//Initialize PdfViewer
PdfViewer pdfViewer = new PdfViewer();
//Load document
//Set image source 
Image customImage = new Image();
customImage.Source = "Expired.png";
//Add image as custom stamp
pdfViewer.AddStamp(customImage, 1, new Point(250, 400));

This code example will add the image as a custom stamp in the location 250X400 in the first page of the PDF document.

Adding a custom dynamic stamp

Dynamic stamps obtain information from your computer and allow you to indicate name, date, and time information on the stamp. Please find the following a reference image for a dynamic stamp.

Adding a custom dynamic stamp.

PDF Viewer lets you add a custom dynamic stamp to a PDF document. The AddStamp method in PDF Viewer is used to add this stamp. The following code example demonstrates how to create and add a custom dynamic stamp to a PDF page.

  <Image  x:Name="approved" Source="Approved.png" Aspect="Fill" />
  <Label  x:Name="dateAndTime" VerticalOptions="End" />
//Add the Date and Time value to the custom stamp/image
Device.StartTimer(TimeSpan.FromSeconds(1), () =>
    Device.BeginInvokeOnMainThread(() => dateAndTime.Text = DateTime.Now.ToString());
        return true;
//Convert the Grid with dynamic date/time text as image
DependencyService.Get<CustomImage>().ConvertToImage(tappedstamp as Grid);
Stream stream= DependencyService.Get<CustomImage>().GetStream();
stream.Position = 0;
//Set image source
Image customImage = new Image();
customImage.Source = ImageSource.FromStream(() => stream);
customImage.HeightRequest = 90;
customImage.WidthRequest = 300;                   
//Add image as custom stamp
pdfViewer.AddStamp(customImage, pdfViewer.PageNumber, new Point(250, 400));

Sample project

You can find a sample project that explains the previous scenarios on GitHub. The following screenshot illustrates the execution of a sample project.

Sample project.

In this sample, we have two custom stamp sections: Standard and Dynamic. The Standard section contains the image of the stamps, whereas the Dynamic section contains the image of the stamp along with the text field displaying the current date and time.

Standard stamps and Dynamic stamps.

To learn more about adding custom stamps and using their features, refer to our documentation page, Working with Custom Stamp annotations.


We hope you now have a better understanding of adding custom stamps to a PDF using the Xamarin PDF Viewer control. By using these custom stamp APIs and events, you can add your own style of custom stamps to your application.

If you are already a Syncfusion user, please download the latest version of Essential Studio from the License & Downloads page and try these new features. Our NuGet packages are available on If you aren’t a customer yet, you can try our 30-day free trial to check out these features. Also, try our other samples from this GitHub location.

If you wish to send us feedback or submit any questions, please feel free to post them in the comments section below, or contact us through our support forumDirect-Trac, or feedback portal. We are happy to assist you!

If you liked this post, we hope you will also enjoy the following:


Share this post:

Comments (2)

When I try your sample and add a custom stamp, on the saved PDF, I have no custom stamp printed.

Do you have an idea why ?

Hi Xavier,

Sorry for the inconvenience. Upon checking, we found issue with the sample uploaded and now it has been resolved. We need to use the “SaveDocumentAsync()” method instead to save the stamps. Kindly check the updated sample from the same GitHub location.

For any further queries, please create a new incident (under your account) from our support website to provide solution quickly and find the support website link from below.


Comments are closed.

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed