I am trying to figure out how to add custom stamp to a pfd document using Syncfusion PdfViewer for ASP.NET Core. From documentation: https://ej2.syncfusion.com/aspnetcore/PdfViewer/Annotations#/fluent you can use such code:
pdfViewer.annotation.addAnnotation("Area", {
offset: { x: 200, y: 500 },
pageNumber: 3,
vertexPoints: [{ x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 }]
});
However when I use it, I get this: "Uncaught TypeError: pdfViewer.annotation.addAnnotation is not a function". Am I doing something wrong?
Here is some more context:
<div style="width:100%;height:1200px">
//Viewer
<ejs-pdfviewer id="pdfviewer" serviceUrl="/api/PdfViewer" documentPath="HTTP Succinctly.pdf" enableToolbar="true"
documentLoad="documentLoaded" ></ejs-pdfviewer>
</div>
<script type="text/javascript">
function documentLoaded(arg) {
var pdfViewer = document.getElementById('pdfviewer').ej2_instances[0];
if (arg.documentName === "HTTP Succinctly.pdf") {
pdfViewer.annotation.addAnnotation("Area", {
offset: { x: 200, y: 500 },
pageNumber: 3,
vertexPoints: [{ x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 }]
});
}
};
</script>