Auto save loaded pdf file whenever there were changes

Hi, 

I just want to ask help or assistance on how to apply autosave in my pdf file whenever I perform annotations. Is there any api that could do the trick? 

Hoping for your response. Thank you.

3 Replies 1 reply marked as answer

AA Akshaya Arivoli Syncfusion Team October 6, 2020 11:45 AM UTC

Hi Mary,  

Thank you for contacting Syncfusion support.  

In our PDF Viewer control on downloading the document, we will save the changes in a new PDF document. Because, we do not make any changes to the document loaded( i.e., original document) in our PDF Viewer control. If we perform the autosave then the original PDF document will get modified. So, can you please let us know whether your requirement is to modify the original loaded PDF document. However, in our PDF Viewer control we will store the added annotation internally in our source code. So you can add annotation in any of the page and click on download icon in the toolbar or by using download() method in the code-behind we save the changes in a new PDF document.  
   
Code snippet;  


<button onclick="save"> save</button>   

function save() {     
var pdfviewer = document.getElementById('pdfviewer').ej2_instances[0];     
pdfviewer.download();    
}   

Please revert whether the provided details meet your requirement and if not, please revert us with more details and the use case if you have concerns.  

Regards,  
Akshaya   




SH Shannara October 7, 2020 06:31 AM UTC

The requirement is to auto save the new pdf file with the annotations. This is to ensure the added annotations will be saved in case there were any unusual error or internet connectivity and the user can still retrieve the pdf with the annotations.

The goal here is to keep the annotations or changes of the pdf file whenever the page refreshed.

Can we modify the original file?

Is there a way to save and retrieve the annotations in vue pdf viewer?


AA Akshaya Arivoli Syncfusion Team October 8, 2020 01:51 PM UTC

Hi Mary,   
  
Thank you for your update.   
  
Please find the details of your query from the below,   
  
Query   
Details    
Can we modify the original file?   
In our pdf viewer, currently, we do not have the autosave option for modifying the original file. However, we can save the modified file by using the download icon in the toolbar or by using the download() method in code behind for saving the file in any local disk and then retrieve the saved file.   




  
Is there a way to save and retrieve the annotations in vue pdf viewer?   
We can save and retrieve the annotations by using exportAnnotations() for saving the changes in any local disk and import the saved annotation data using importAnnotations(importData) method.   
  
Please find the sample for your reference.   
  
    
  

  
Please try it and revert us with more details about your issue, code snippet, modified sample, and replication procedure. These details will be helpful for us to investigate further and assist you better.     


    
Regards,    
Akshaya    


Marked as answer
Loader.
Up arrow icon