Which product are you using?
PDF.js Express Plus
PDF.js Express Version
8.7.3 (with pdfjs-express-utils v1.3.1)
Detailed description of issue
Many of our users are receiving a 500 internal server error with an error message of “Server-side request must use server-side key” when calling the .merge() function (API call of /merge
) from the client side. Users are likely on a VPN or have a network proxy in place. Could that be interfering, and is there any way to avoid this issue?
Expected behaviour
The merge
function should work on all client’s chrome browsers.
Does your issue happen with every document, or just one?
Only some users are facing this issue, but it happens consistently for all documents for these users.
Link to document
{Provide a link to the document in question if possible}
Code snippet
async function mergePdfAnnotations(
viewerInstance: WebViewerInstance,
fileUrl?: string,
) {
const {
Core: { annotationManager, documentViewer },
} = viewerInstance;
if (fileUrl) {
expressUtils.setFile(fileUrl);
} else {
const fileData = await documentViewer.getDocument().getFileData({});
const blob = new Blob([fileData], { type: "application/pdf" });
expressUtils.setFile(blob);
}
const xfdf = await exportPdfAnnotations(annotationManager, true);
expressUtils.setXFDF(xfdf);
const response = await expressUtils.merge(); // merge XFDF
const mergedFile = await response.getBlob();
await response.deleteFile(); // remove file from the server
return mergedFile;
}