How to merge signature annotation with PDF document

PDF.js Express Version

Detailed description of issue
Hello,

I have a problem to merge any annotation with PDF document?
I add the signature or any other annotation and then expect that document will have annotation attached to it after, but it doesn’t have.
I am calling annotManager.exportAnnotations() in order to then pass xfdfString to getFileData
function. Later, when I construct Blob and then download it, it doesn’t contain signature in it.

Expected behaviour
I’m expecting to have annoation after I create and download Blob.

Does your issue happen with every document, or just one?
That is happening with every document.

Code snippet

const myFN = async () => {
const doc = docViewer.getDocument();
const xfdfString = await annotManager.exportAnnotations( {links: false, widgets: false});

                      const data = await doc.getFileData({
                        xfdfString
                      });
                      
                      const arr = new Uint8Array(data);
                      const blob = new Blob([arr], { type: 'application/pdf' });
                      // const element = document.createElement("a");
                      const file2 = new File([blob], "updatedFile.pdf", {type: 'application/pdf'});
                  
                       }

Hey there!

PDF.js Express does not support merging annotations into the document on the client. If you want this functionality, pleas check out our sister product, PDFTron WebViewer which has this functionality.

Or, you may use the PDF.js Express REST API which has an endpoint that merges annotations into the document. See the documentation here.

Thank you!
Logan