Before merge
After merge
Colors, strikes, underline…etc disappeared after merge
Hello, I’m Ron, an automated tech support bot
While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:
Guides:Hi Iakshan,
How are you merging the annotations, are you using the REST API? If so, can you provide the code snippet?
Here is a quick guide:
If not, this is another way by using export/import annotation commands:
Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.
www.pdftron.com
Server side code (NodeJS):
exports.mergeAnnotations = async function (req, res) {
const utils = new Utils({
serverKey: process.env.serverKey,
});
utils.setFile(req.body.file).setXFDF(req.body.xfdf);
const response = await utils.merge(); // merge XFDF
// const response = await utils.set(); // or set XFDF
const mergedFile = await response.getBlob();
//await response.deleteFile(); // remove file from the server
res.send({ url: response.url, key: response.key, blob: mergedFile });
};
Client side code:
const xfdf = await annotManager.exportAnnotations({ links: false, widgets: false });
const fileData = await docViewer.getDocument().getFileData({});
const blob = new Blob([fileData], { type: "application/pdf" });
pdfExpressData.append("file", blob);
pdfExpressData.append("xfdf", xfdf);
// Process the file
const response = await fetch("/merge-annotations", {
method: "post",
body: pdfExpressData,
}).then((resp) => resp.json());
const { url, key, mergedBlob } = response;
// Download the file
const mergedFileBlob = await fetch(url, {
headers: {
Authorization: key,
},
}).then((resp) => resp.blob());
var pdfblob = new Blob([mergedFileBlob], { type: "application/pdf" });
Hi Iakshan,
It looks like you are not including the licence key in the request body, and without a license key, the output actions in localhost will be watermarked/mangled.
If this is a production environment, are you using the right server key and client key in the respective back and front end environments?
Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.
Added both server side and client side keys. But issue is still there
Server side code:
Client side code:
Hi Iakshan,
Are you testing the merge on localhost?
Also, if you have the paid key for the server, are you being domain locked? If not are you seeing the same results?
Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.
Hi Iakshan,
Upon further investigation, it looks like PDFJS Express does not support custom appearance. If you look at the console, there should be a warning indicating ‘Custom appearances are unavailable in PDFJS Express’
Apologies for the confusion.
Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.