Export / import Annotations - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Windows 8.1, 10, WindowsPhone, Windows UWP
  • Page:
  • 1
  • 2

TOPIC: Export / import Annotations

Export / import Annotations 1 year 7 months ago #12176

  • rau.fernandez@abamobile.com
  • rau.fernandez@abamobile.com's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
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.

Please Log in or Create an account to join the conversation.

Export / import Annotations 1 year 7 months ago #12189

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 865
  • Karma: 23
  • Thank you received: 70
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.

Please Log in or Create an account to join the conversation.

Export / import Annotations 1 year 7 months ago #12204

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 865
  • Karma: 23
  • Thank you received: 70
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:
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;
 }
The following user(s) said Thank You: rau.fernandez@abamobile.com

Please Log in or Create an account to join the conversation.

Export / import Annotations 1 year 7 months ago #12216

  • rau.fernandez@abamobile.com
  • rau.fernandez@abamobile.com's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
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.

Please Log in or Create an account to join the conversation.

Export / import Annotations 1 year 7 months ago #12218

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 865
  • Karma: 23
  • Thank you received: 70
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?

Please Log in or Create an account to join the conversation.

Export / import Annotations 1 year 7 months ago #12221

  • rau.fernandez@abamobile.com
  • rau.fernandez@abamobile.com's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
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.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum