Drop custom stamp programmatically using PdfViewerServer

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.



2 Replies 1 reply marked as answer

SK Shamini Kiruba Sobers Syncfusion Team February 18, 2022 07:23 AM UTC

Hi Gary, 

Currently, there is no support to add a custom stamp programmatically in the Blazor platform. We have implemented it in our EJ2 platforms as in the below demo. 

The feature implementation “Add annotations programmatically” is implemented in the EJ2 platforms and not in the Blazor platform. However, we will consider this feature implementation in the Blazor platform. We don’t have any immediate plans to implement this feature. We will let you know when this feature is implemented. The status of implementation can be tracked through the below link. 
 
 
Regards, 
Shamini 


Marked as answer

GS Gary Silva Vivanco February 19, 2022 07:20 PM UTC

It's ok, thank you very much for your assistance.


Loader.
Up arrow icon