Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Windows 8.1, 10, WindowsPhone, Windows UWP

Export / import Annotations

More
IP: 192.168.0.71 8 years 11 months ago #12176 by [email protected]
Hi!
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 in advance.
More
IP: 192.168.0.71 8 years 11 months ago #12189 by nermeen
Replied by nermeen on topic Export / import Annotations
Sorry for the late reply.
- We have found an issue for the calculation of the total annotations' count for these types, our developers are checking it, we will get back to you as soon as it's fixed.

- To find this class in your project, you need to update the SDK to the latest version, but you can wait till the first issue is fixed, so that you update only once.
More
IP: 192.168.0.71 8 years 11 months ago #12204 by nermeen
Replied by nermeen on topic Export / import Annotations
A new version 1.9.32beta2 has been published, with a fix to annotation count issue.

To get the last created annotation, you can use page.GetAnnot(page.AnnotCount - 1)

To export the annotations you need to save the info needed to recreate them like (page no, type, rectangle(position), fill color, stroke color,....)
Something like:
Code:
PDFAnnot mAnnot = page.GetAnnot(i); PDFRect mRect = mAnnot.Rect; int type = mAnnot.Type; int fillColor = mAnnot.FillColor; int srokeColor = mAnnot.StrokeColor; if (type == 15) { //ink PDFPath path = mAnnot.InkPath; }
More
IP: 192.168.0.71 8 years 11 months ago #12216 by [email protected]
Hi!
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.

Thanks again.
More
IP: 192.168.0.71 8 years 11 months ago #12218 by nermeen
Replied by nermeen on topic Export / import Annotations
Make sure to save before closing and when you close the document, you need to reopen it.
If this what you are doing already, can you share your code please?
More
IP: 192.168.0.71 8 years 11 months ago #12221 by [email protected]
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?

Thanks.
Time to create page: 0.460 seconds
Powered by Kunena Forum