How to merge FDF annotations with PDF?

Q:
I'm trying to import annotations from a FDF file to a PDF file. Does
the PDFNet SDK have the functionality to import annotations from FDF
to PDF?

I'll try to explain, what I need.
1) There will be a PDF file (a.pdf)
2) Someone will do annotations on it and save them to FDF (a.fdf)
3) The annotations of the FDF file will be imported to the PDF file
(a.pdf <- a.fdf)
4) Someone will open the PDF (a.pdf), do a reply to the annotations
and save them to FDF (a.fdf)
5) The annotations (with replies) of the FDF file will be imported to
the PDF file again (a.pdf <- a.fdf)
6) Maybe it continues at 3)

After the second import there must not exist double annotations in the
PDF file.
----
A:

Using PDFNet you can import annotations from FDF to PDF using
pdftron.SDF.Doc.ImportObj() method.

To find the relevant article and sample code search for "Merging
annotations with PDF on the server" in this knowledge base (or in
http://groups.google.com/group/pdfnet-sdk)

In the above example all annotations are placed on the first page,
however you can use 'Page' entry in the annotation dictionary to find
the destination page number. For example,

Obj annot_dict = annots.GetAt(i);
DictIterator itr = annot_dict.Find("Page");
if (itr != annot_dict.DictEnd()) {
  // Note: in FDF, pages are numbered starting from 0; PDFNet numbers
pages starting from 1.
  int page_num = (int) itr.Value().GetNumber() + 1;
  ...
}

For more information on how to use SDF/Cos API please take a look at
following links:
  http://www.pdftron.com/net/usermanual.html#sdf_obj
  http://www.pdftron.com/net/samplecode/SDFTest.cs

After the second import there must not exist double annotations in the PDF file.

Since you have full control over the merging process you could
determine if a given annotation is being modified or is it newly
created by checking if the annotation bounding boxes & types match or
by maintaining custom entries/properties.