Ability to Download Flattened PDFs

Good day!

We've been using the PDF Viewer tool on our website and so far it has been a great tool.

As part of the features we'd like to improve for use is to provide a PDF download version that is read-only (flattened). We searched for most of the documentation and the community forums for anything regarding this matter, and so far the most that we've been able to find is the ability to print the PDF instead of downloading it (reference).

We might continue forward with this ability to print the PDF instead of downloading it, but we noticed that quality for the original text within the PDF is a bit downgraded.

Is it possible to somehow generate a PDF that is already flattened with the SyncFusion API? If not, could the quality of printed images somehow be improved upon?

Looking forward to your response.


1 Reply

SK Shamini Kiruba Sobers Syncfusion Team December 9, 2021 03:25 AM UTC

Hi Héctor, 

Greetings from Syncfusion support. 

We suggest using the isLock property of PDF Viewer to lock all the annotations in the PDF file so that the annotations in the downloaded file cannot be edited. The sample and code snippet to lock the annotations can be found below. 


Code snippet: 

<button onclick="lock()">Lock Annotations</button> 
 
<ejs-pdfviewer id="pdfviewer" style="height:600px" serviceUrl="/api/PdfViewer" documentPath="PDF_Succinctly.pdf"></ejs-pdfviewer> 
 
<script> 
    lock = function (args) { 
        var viewer = document.getElementById('pdfviewer').ej2_instances[0]; 
        var annotationCollection = viewer.annotationCollection; 
        for (var i = 0; i < annotationCollection.length; i++) { 
            annotationCollection[i].annotationSettings.isLock = true; 
            viewer.annotationModule.editAnnotation(viewer.annotationCollection[i]); 
        } 
    }; 
</script> 

Kindly look into the following documentation of our PDF library which might help you generate a PDF for your requirement. 

Please let us know if this satisfies your requirement. 

Regards, 
Shamini

Loader.
Up arrow icon