Posted 19 February 2024, 4:57 am EST
Hello,
We are sorry for the inconvenience for the delayed response on this. It seems that you are able to pre-fill the data in the PDF before showing to the PDF.
And now you are looking how you may flatten the PDF on saving. If yes, please use the custom save button and call the following code snippet before saving the PDF changes.
v=DsPdfViewer.findControl("#viewer")
v.annotations.then(function (result) {
for(let i=0;i<result.length;i++){
var annotaions = result[i].annotations;
for(j=0;j<annotaions.length;j++){
annotaions[j].convertToContent = true;
}
v.updateAnnotations(result[i].pageIndex,annotaions);
}
})
Custom Save Button Sample:
https://developer.mescius.com/document-solutions/javascript-pdf-viewer/demos/ui-customization/save-changes/purejs
We want to pre-fill programatically a PDF form and then display it in the Pdf Viewer.
If you are facing any issue in above. Please do elaborate your scenario. How the PDF is created and how you would like to fill the data for the PDF.
Regards,
Manish Gupta