Hello Thomas,
thank you for your help. Now i have find the way to show me the structure auf annotations and they replies. I have a problem when i try to add a replay with code.
I try it with the following code:
private static void CreateReply(PDFDoc doc, Annot annot)
{
var txt = pdftron.PDF.Annots.Text.Create(doc, new Rect(161, 388, 180, 406), “Hello World”);
var pop = pdftron.PDF.Annots.Popup.Create(doc, new Rect(272, 300, 450, 450));
pop.SetParent(txt);
txt.SetPopup(pop);
txt.SetColor(new ColorPt(1, 0, 0));
txt.GetSDFObj().Put(“IRT”, annot.GetSDFObj().Find(“NM”).Value());
txt.RefreshAppearance();
var page = doc.GetPage(annot.GetPage().GetIndex());
page.AnnotPushBack(txt);
page.AnnotPushBack(pop);
}
I thought after reading the specification it is enought to add the IRT value to the reply annotation and push it in the same page. but when i open the pdf document in a reader then i have an extra popup with text!
What is the right way to add replies through the code.
Daniel
Am Freitag, 18. Oktober 2013 01:23:14 UTC+2 schrieb Tomas Hofmann:
Hi Daniel,
To match of annotations that are replies to earlier annotations you want to look for the IRT and RT dictionary entries. The IRT is the “In Response To” entry and specified the previous comment. The RT entry is the “Reply Type”, of which there are two, R and Group. See the PDF spec for more on them, though I suspect you would only have to worry about R type. R is the default.
Note that the original annotation has no reference to the first reply, so basically you would have to work your way forwards to get the full chain.
See the Markup Annotation entries in any PDF spec starting at PDF 1.5, for details. You can also use our COSEdit tool that comes with PDFNet for Desktop.
Finally, this is an old posting somewhat related to this subject that you might find useful.
https://groups.google.com/forum/?fromgroups#!searchin/pdfnet-sdk/IRT/pdfnet-sdk/PndHkcXORgo/j-vkeyXPEaoJ
In order to change this in the tools source code, you might want to take a look at the NoteHost class. What that class does is that it creates the yellow widget from your screenshot and adds the content from the popup attached to annotation 1.
What you will have to do is to at this point look at the page that the annotation is on, loop through the annotations and look for these IRT and RT fields and then edit the way the note is displayed.
Best Regards,
Tomas Hofmann
On Thursday, October 17, 2013 3:22:26 AM UTC-7, Daniel Lutz wrote:
Hello Thomas,
i try to explain exactly what i mean.
The picture shows a comment what i made with a pdf-viewer. When i used the SDK then i get the follow picture:
The information that the comment has a answer is not displayed. So i wont build an new popup with the function to display the comment structure.
When i used the sdk to get all annotations from the document i get the following:
1. Annots.Text
→ Content: Question
→ Titel:
2. Annots.PopUp
→ Content: Question
→ Parent: 1.
3. Annot.Text
→ Content: Answer
→ Titel: Daniel
4. Annot.PopUp
→ Content: Answer
→ Parent: 3.
The first question is how i can identify that the text by number 3 is a answer of the comment text by number 1.
The secound question is how i can override the popup which is display in the sdk picture above.
I hope you understand my questions.
Daniel