Tracked Changes/Suggestions

Hello!

I would like to import a pdf into the editor, and have a user track changes/make suggestions that we can capture externally as well as display on the final product within the editor. Is there a feature in this library that can assist with that? 

5 Replies

SM Suriya Murugan Syncfusion Team February 4, 2021 10:52 AM UTC


Hi Amanda, 

Syncfusion Greetings! 

Currently, we don’t have any library for Pdf to Docx conversion to import pdf document in editor. 
 
Please let us know if you need any further assistance.  

Regards, 
Suriya M. 



AI Amanda Iverson February 4, 2021 05:01 PM UTC

Ok, Thank you!

I do have another question to build off of that. I would like to be able to annotate a PDF text document with changes, is it possible for me to capture the page number and line number that the pdf document annotation occurred? 


VS Vasugi Sivajothi Syncfusion Team February 5, 2021 04:58 PM UTC

Hi Amanda, 
  
We can retrieve the annotation details using annotationCollection object.  
Please refer to the below code snippet: 
Code snippet: 
  
var pdfViewer = document.getElementById('pdfviewer').ej2_instances[0]; 
 
console.log(pdfViewer. annotationCollection); 
  
  
  
And can you please confirm whether you need the annotation details  while annotation are rendering on UI or while saving the document in server side. 
  
Kindly try it and revert us with more details if the provided solution is not meet your requirement. 
  
Regards, 
Vasugi 



AI Amanda Iverson February 5, 2021 05:08 PM UTC

Thank you for the reply.

I would like to capture the annotation details when saving on the server side if possible, but if i am only able to capture the line number and page number on the UI side, I can make that work. 




VS Vasugi Sivajothi Syncfusion Team February 8, 2021 11:03 AM UTC

Hi Amanda, 
 
Thanks for the update. 
We can retrieve the annotation bounds and page number on the server-side while saving or downloading the PDF document by using the below code-snippet, We have created the sample in which we have modified the PDFViewerController.cs file Download method. Kindly refer to the sample below. 
Code Snippet: 
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); 
        } 
 
Kindly try it and revert us with more details if the provided solution is not meet your requirement. 
 
Regards 
Vasugi 


Loader.
Up arrow icon