Hello All,
I'm using PdfViewerController net core webApi for my angular pdf viewer. The issue happens when you leave the pdf loaded for 10 minutes sync fusion invalidates the cache and Export annotaion fucntion return the following error: Object reference not set to an instance of an object.
Export API :
[AcceptVerbs("Post")]
[HttpPost("ExportAnnotations")]
[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")]
[Route("[controller]/ExportAnnotations")]
//Post action to export annotations
public IActionResult ExportAnnotations([FromBody] Dictionary<string, string> jsonObject)
{
PdfRenderer pdfviewer = new PdfRenderer(_cache);
string jsonResult = pdfviewer.GetAnnotations(jsonObject);
return Content(jsonResult);
}
The highlighted line return the mentioned error.
This happens after 10 minutes of calling load API.
Angular Call :
this.pdfviewerControl.exportAnnotationsAsObject()
I've attached the webAPI file.
Thanks,
Mohamed
Attachment:
PdfViewerController_430879cb.rar