I´m trying to export/import annotations with get/set methods and I´m finding some problems.
- I create a rectangle or an ellipse annotation in the first page of a document. When I try to get the annotation with the following code I get 128 different annotations.
PDFPage page = m_doc.GetPage(0);
int size = page.AnnotCount;
When I create an ink path, AnnotCount returns one annotation.
What is the correct way to export / import the annotations?
- I´m using the internal release you provide me with the interface PDFAnnot.InkPath, but I can not find this classes in my project. instead PDFInk, ¿is it the correct?
Thanks for your fast answer.
Now the annotation count bug is fixed, but I still have one more problem.
- When I try to loop over the pages to get all annotations, it only returns the annotations which are in the current page.
For example, a document with 3 pages. If I put an annotation in page 1 and I close the document viewing page 3, when I use page.AnnotCount for page 1, returns 0. But If I close the document in page 1, it returns correctly the annotation.
We are trying to get the annotations without saving them in the pdf file.
Is it mandatory to save the file and then re open to get the annotations?
I have another question, I try to set an annotation in a new pdf, using something like this
rect = new PDFRect();
rect.bottom = 688.476563F;
rect.top = 206.476563F;
rect.right = 377.80426F;
rect.left = 566.2051F;
strokeWidth = 0.8957775F;
bool b1 = page.AddAnnotEllipse(rect, strokeWidth, 12821, 51212);
b1 is true but I cannot see the annotation.
which is the correct way to set the annotations?