PDF.js Express Viewer
version :6.3.4
https://api.pdfjs.express/xfdf/merge is getting 502 errors when sending requests to Merge XFDF. Please fix this issue as a priority.
var xfdf = await annotManager.exportAnnotations({ links: false, widgets: false });
var fileData = await docViewer.getDocument().getFileData({});
var data = new FormData();
data.append('xfdf', xfdf);
data.append('file',file_name);
data.append('license','');
// Process the file
var response = await fetch('https://api.pdfjs.express/xfdf/merge', {
method: 'post',
// mode: 'no-cors',
body: data
}).then(resp => resp.json());
var { url, key, id } = response;
// Download the file
var mergedFileBlob = await fetch(url, {
headers: {
Authorization: key
}
}).then(resp => resp.blob())
var data_PDF = new FormData();
data_PDF.append('data' , mergedFileBlob);