|
[AcceptVerbs("Post")]
[HttpPost("ExportFormFields")]
[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")]
[Route("[controller]/ExportFormFields")]
public IActionResult ExportFormFields([FromBody] Dictionary<string, string> jsonObject)
{
PdfRenderer pdfviewer = new PdfRenderer(_cache);
string jsonResult = pdfviewer.ExportFormFields(jsonObject);
return Content(jsonResult);
}
[AcceptVerbs("Post")]
[HttpPost("ImportFormFields")]
[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")]
[Route("[controller]/ImportFormFields")]
public IActionResult ImportFormFields([FromBody] Dictionary<string, string> jsonObject)
{
PdfRenderer pdfviewer = new PdfRenderer(_cache);
object jsonResult = pdfviewer.ImportFormFields(jsonObject);
return Content(JsonConvert.SerializeObject(jsonResult));
}
|
|
Query |
Details | |
|
Ok so. I understand now that I have to use :
to import from a json ?
|
Yes can import/export using the importAnnotations() and exportAnotations() API available in PDF Viewer. | |
|
https://ej2.syncfusion.com/vue/documentation/api/pdfviewer/#addannotation to directly add an annotation on the client side. I'll try that but if you have an example ready that would be awesome ! |
We can add the annotations programmatically using addAnnotation().Please refer to the below code
Web Service: https://www.syncfusion.com/downloads/support/forum/157796/ze/PDFViewerWebService_(10)303953807
We can also get the annotationcollection from the annotation events then we add it using the addAnnotation()
Note: Run the web service project and then the JavaScript. Draw an annotation and click on the Add Annotation button, the same annotation will be added again
Please try it and revert us with more details about your requirement and the use case, if you still have concerns. These details will be helpful for us to investigate further and assist you better.
|
Yes can import/export using the importAnnotations() and exportAnotations() API available in PDF Viewer. |
|
Query |
Details |
|
There is no example or documentation that detail the JSON format that we should provide. Or I couldn't find it. |
We have created sample to import/export annotation and shared the same in the below link,
Web Service: https://www.syncfusion.com/downloads/support/forum/157796/ze/PDFViewerWebService_(10)303953807
Kindly run the web service project and provide that URL to the serviceUrl property of the PDF Viewer. |
|
Do you have an example that show how to create a shape annotation from scratch please ? |
We can use the import annotation API to add the annotations from code behind in the client side.
If your requirement is add the annotations from the code behind in the server side, please refer to the below link,
Please try it and please provide more details about your requirement and the use case. These details will be helpful for us to investigate further and assist you better.
|