Hi,
Can you tell me how to add FreeText annotation in our PDF viewer programmatically? Let's say I have a custom button in my application and clicking the button should add the free text annotation at specific location in the PDF viewer.
Let me know.
Thanks
Refer the below code snippet and sample to add the free text annotation at a specific location in the PDF viewer.
Code snippet:
addFreeText() { var pdfViewer = (<any>document.getElementById('pdfViewer')) .ej2_instances[0]; pdfViewer.annotation.addAnnotation("FreeText", { offset: {x: 100, y: 100}, fontSize:16, fontFamily: "Helvetica", pageNumber: 1, width: 200, height: 40, isLock: false, defaultText: "Syncfusion", }) } |
Thanks for your reply.
Find the details for the respective queries
Is there anyway to get the annotation ID of the newly
added free text annotation? |
Yes, while adding the annotation in the PDF Viewer annotationAdd event is triggered by using this event you can get the newly added annotation id. Refer the below code snippet and sample to get the newly added free text annotation id in the console.
|
|
How to update the content of an existing Free text annotation programmatically. |
Refer the below code snippet and sample to change the content of an existing Free text annotation programmatically.
Code snippet:
|
|
How to move the free text annotation programmatically. |
Refer the below code snippet and sample to move
the free text annotation programmatically.
|