How to save and retrieve the annotations from the database?
You can save and retrieve the TextMarkup annotations separately from the PDF viewer as a workaround. Refer to the following code,
In the above sample, a button Save Annotations is provided for saving the annotations included in the PDF viewer control to the database table. The annotations which are added, modified and deleted will be added to the database when the Save Annotations button is clicked.
Another button Show Annotations is provided for showing the saved annotations as html list, so that user can click on the annotation and the saved annotation will be retrieved from the database and included in the PDF document and the PDF viewer control is launched again.
During this operation, the annotations that are added as single annotation will be saved as multi-line markup annotation and on clicking the html list only that part of the annotation will be rendered in PDF Viewer. Because, at present we do not support to add text markup annotations across multiple lines as single annotation.
Modify the web action methods in the API controller as per your entries in database. We have three entries ID, PageNumber and Annotation to store ID of the PDF document and the serialized string with annotation. Also, modify the connection string of the database in the web.config file.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|