|
var pdfViewer = document.getElementById('pdfviewer').ej2_instances[0];
console.log(pdfViewer. annotationCollection);
|
|
public IActionResult Download([FromBody] Dictionary<string, string> jsonObject)
{
PdfRenderer pdfviewer = new PdfRenderer(_cache);
string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject);
string base64String = documentBase.Split(new string[] { "data:application/pdf;base64," }, StringSplitOptions.None)[1];
if (base64String != null || base64String != string.Empty)
{
byte[] byteArray = Convert.FromBase64String(base64String);
MemoryStream docStream = new MemoryStream(byteArray);
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream);
for (int i=0;i< loadedDocument.Pages.Count;i++)
{
PdfLoadedPage loadedPage = loadedDocument.Pages[i] as PdfLoadedPage;
for (int j = 0; j < loadedPage.Annotations.Count; j++)
{
PdfLoadedTextMarkupAnnotation loadedMarkup = loadedPage.Annotations[j] as PdfLoadedTextMarkupAnnotation;
if(loadedMarkup != null)
{
var annotationLocation = loadedMarkup.BoundsCollection; // bounds of the annotation
int annotationPage = i;//page number
}
}
}
}
return Content(documentBase);
} |