Merging annotations in XFDF with pdf

Dear All

Till now, I could see few details and sample about merging form data
with pdf.
But now, I am trying to merge xfdf with pdf file where xfdf does not
contain form data, instead it contains
annotations (and highlights, comments) xml segment and that I need to
merge with pdf.

A samle xfdf can be like below:

<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><f
href="test.pdf"/><ids original="" modified=""/><annots>

<text icon="Comment" title="spp07339" creationdate="D:
20120105153702+0539;3039;" subject="Note" page="0" date="D:
20120105153710+0539;3039;" flags="28" name="null"
rect="161.891144,240.813141,179.891281,258.812927" color="#CC3399">
<contents-richtext><body xmlns="http://www.w3.org/1999/xhtml"
xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
xfa:APIVersion="Acrobat:7.0.8" xfa:spec="2.0.2" style="font-size:
12.0pt;text-align:left;color:#000000;font-weight:normal;font-
style:normal;font-family:Arial;font-stretch:normal"><p><span
style="font-family:Arial;font-size:12.0pt">Test by admin</span></p></

</contents-richtext><popup open="no" page="0" date="D:

20120105153710+0539;3039;" flags="28" name=""
rect="161.891144,164.812744,361.891144,276.812744" /></text>
</annots></xfdf>

Using pdf-xchange viewer, xfdf can be imported to pdf file and a new
pdf file is generated with annotations and markup.

But I want to know if this can be done with PDFTron or any other way
for this?
I understand that XFDF and FDF are mainly for form data but I am sure
xfdf has other purposes also.

Regards
Sagar

The support for XFDF merge/extract (doc.FDFExtract(PDFDoc.ExtractFlag.e_annots_only), SaveAsXFDF()) was recently added as part of PDFNet v.5.8.2). For an example of how to use API please see the attached (updated) FDF sample project:

http://www.pdftron.com/ID-f94ls2-edm0aqZ/PDFNet.zip

http://www.pdftron.com/ID-f94ls2-edm0aqZ/PDFNet64.zip

http://www.pdftron.com/ID-f94ls2-edm0aqZ/PDFNetDotNet4.zip

http://www.pdftron.com/ID-f94ls2-edm0aqZ/PDFNet64DotNet4.zip