PDFTron C# library does not correctly render annotations when using MergeXFDF

Product: PDFTron.NET.x64.

Product Version: 10.1, 10.4.0

Please give a brief summary of your issue:
Using MergeXFDF function does not correctly render the markups contained in the xfdf string.

  • Replies do not show under the parent markup but instead is shown along side it.
  • The status of the markup does not show in the generated file.

Please describe your issue and provide steps to reproduce it:

1.) Open a pdf file via the c# library
2.) Call the MergeXFDF function with either of the provided files as parameter

  1. from-code4.xfdf (2.9 KB) (generated using my own code)
  2. from-pdftron2.xfdf (2.9 KB) (generated using exportAnnotations function of webviewer)

3.) call doc.save() function
4.) Inspect the generated file

Expected Result: Markup has a reply and is shown as such, the status of the markup is also shown

Actual Result: Markup’s reply is shown as another markup and the status of the parent markup is not shown

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

1 Like

I would like to add that, markups that are grouped also don’t render correctly. Only the parent markup in the group appears.

from-code-grouped2.xfdf (22.9 KB)

1 Like

Some further info about this issue,

Initially What I did was to loop through my command xfdf strings and call doc.MergeXfdf for each one of them. When I checked the resulting pdf file. It appeared like in the screenshot provided above where replies are not shown as such.

I realized that there might be issues when calling MergeXFDF one by one for each command xfdf string so I what I did next was to combine each xfdf command string into one and manually create an exported XFDF string (seen in from-code4.xfdf) and only call MergeXFDF once. But this still didn’t do what I wanted.

Finally I tried to use

        FDFDoc fdf_doc = new FDFDoc(FDFDoc.CreateFromXFDF(xfdf));


passing my XFDF string there but it still didn’t fix my issue.

I would like to follow up on my concern.

1 Like

Thank you for the detailed report. I am investigating with the team and will update you once I know more.

my command xfdf strings

In meantime, to clarify, none of the XFDF files you sent are “command” xfdf, but instead regular xfdf files.

1 Like

I have resolved my issue,

FDFDoc fdf_doc = new FDFDoc(FDFDoc.CreateFromXFDF(xfdf));


worked for me in resolving my issue in rendering. It now displays markups with replies correctly as well as the markup’s state (accepted,rejected,etc).

As for my issue regarding grouped markups was not due to the PDFTron C# library but was due to logic on my end.


1 Like

Hi Ryan,

Yes, the xfdf files I sent aren’t command xfdf. I used my command xfdf strings and extracted the markup part for each one of and combine them into one xfdf file which is the file I sent.

1 Like

I am happy to report that this has been corrected, and the fix will be available in our Dec 6th 10.6 SDK release.

To get notified for the next official SDK release you can join our Discourse Announcements channel.

For platform specific notifications, such as Nuget, NPM, CocoaPods, please see the respective Apryse product documentation page.

1 Like