XFDF renders differently when using doc.getFileData

Product: PDFTron SDK Js

Product Version: 8.2.0

Please give a brief summary of your issue:

  1. My annotations is rendered differently when I use doc.getFileData vs what I expect the results should be.

  2. This is what I expect the rendered annotations should be:

  3. This is the rendered annotation when I use doc.getFileData

  4. As you can see, when I use doc.getFileData, The replies to the markup with author “MAI” become independent markups.

  5. My code to generate the pdf is the following:

const downloadAsync = async (url, fileName, xfdf) => {

  return new Promise(async (resolve, reject) => {

    const licenseKey = pdfTronLicenseJs;
    const documentURL = url;
    const extension = 'pdf'; // pass extension to option if there is no file extension in documentURL

    try {

      let doc = await CoreControls.createDocument(documentURL, { l: licenseKey, extension });

      const options = {
        xfdfString: xfdf,
        flags: CoreControls.SaveOptions.LINEARIZED

      let data = await doc.getFileData(options);

      const arr = new Uint8Array(data);
      const blob = new Blob([arr], { type: 'application/pdf' });
      saveBufferAsPDFDoc(blob, fileName);      

    } catch (err) {


url = url of the pdf file
filename = filename of the pdf file
xfdf = the xfdf string to combine with the downloaded pdf file
  1. The xfdf file I used.
    PGRP-4453-oval-issue-from-pdftron-from-downloadAsync.xfdf (1.0 MB)
  2. The pdf file I used.
    Fixation_Requirements_in_Tunnels_(Guidelines)_JBV_JAM no markup.pdf (1.4 MB)
  3. the Id of the markup in question is “ab2114c2-516c-42ca-b1b3-abab875dd914”

Please describe your issue and provide steps to reproduce it:
1.) Run the code above using the pdf file and xfdf file provided.

Please provide a link to a minimal sample where the issue is reproducible:

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:



I would like to follow up on my concern

Hello Adrian,

I was able to successfully run your code using the files you provided, so thank you for the detailed report.
We will investigate and let you know when we have further information.

Best Regards,
Ahmad Moaaz
Software Developer
PDFTron Systems, Inc.

Hello Adrian,

I have identified the issue to be an issue with the XFDF file.
If replace \\&quot with \&quot throughout the file. The imported XFDF works as expected.
How was this XFDF file generated?

Best Regards,
Ahmad Moaaz
Software Developer
PDFTron Systems, Inc.