Hello everyone, I'm trying to add and drop a custom stamp programmatically in a pdf document using PdfViewerServer in a Blazor web app, but I can't find the way to do it.
I'm currently able to create the custom stamp programmatically but when I create the stamp I still have to click on the desired place on the document to drop it, but what I'm trying to do is to drop it
in a specified point using code, so the user only have to drag the already placed stamp in order to relocate it.
<input type="button" value="AddStamp" @onclick="AddCustomStamp"/>
<SfPdfViewerServer @ref="PdfViewer" DocumentPath="@DocPath" EnableFormFields="false" EnableNavigationToolbar="false" EnableAnnotationToolbar="true" EnableToolbar="true" Height="100%" Width="100%" >
<PdfViewerCustomStampSettings EnableCustomStamp="true" CustomStamps="@CustomStamps"> </PdfViewerCustomStampSettings>
</SfPdfViewerServer>
@code
{
public SfPdfViewerServer PdfViewer { get; set; }
private List<PdfViewerCustomStamp> CustomStamps { get; set; }
private string DocPath { get; set; } = @"C:\Users\gary\Documents/Luna.pdf";
public void AddCustomStamp()
{
CustomStamps = new List<PdfViewerCustomStamp>()
{
new PdfViewerCustomStamp()
{
CustomStampName = "Stamp",
CustomStampImageSource = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==",
}
};
}
}
Thanks in advance for your help.