Page 1 of 1

PdfInkAnnotation draw with a Bezier curve

Posted: Wed Jul 01, 2020 9:35 pm
by IntegraMike
Hi, I'm looking to mimic the behavior of Adobe with the ink annotation. Currently when you draw an ink annotation there it draws a line from point to point while your drawing and when you exit edit mode it smooths that line into a curve (which appears to be a bezier curve). I'm looking to do the same, but I am not seeing a way to do it other than completely re-implementing the SetAppearance method since I want to keep the other behavior but update the way the draw is being processed. Is there a good way for me to do this, or is would it be possible to have this added as an option in the future?

Thanks!

Re: PdfInkAnnotation draw with a Bezier curve

Posted: Thu Jul 02, 2020 2:21 pm
by Alex
Hi Mike,

You need to override the appearance generator of PdfInkAnnotation class if you want to solve your task with current version of SDK.

We will add the ability to enable/disable smoothing for contour of PdfInkAnnotation in 1-2 weeks.

Best regards, Alexander

Re: PdfInkAnnotation draw with a Bezier curve

Posted: Thu Jul 02, 2020 7:43 pm
by IntegraMike
That sounds great, thank you!

Re: PdfInkAnnotation draw with a Bezier curve

Posted: Tue Jul 07, 2020 5:11 pm
by Alex
Hi Mike,

In version 9.1.1.1 we have created new methods - PdfInkAnnotationAppearanceGenerator.DrawAppearance and PdfInkAnnotationAppearanceGenerator.CreateAppearancePath, which allow to override the algorithm that renders appearance of PdfInkAnnotation.

Please use methods for overriding the appearance of PdfInkAnnotation class and let me know if you will have any question or problem.

We tried to implement algorithm similar to the smoothing algorithm in Adobe but understood that we need more time for implementation of algorithm.

Best regards, Alexander

Re: PdfInkAnnotation draw with a Bezier curve

Posted: Thu Jul 16, 2020 2:40 pm
by Alex
Hi Mike,

In version 9.1.1.3 we added the ability to use the line smoothing in appearance generator of PdfInkAnnotation class. This functionality is enabled by default.
You can disable the line smoothing in appearance generator of PdfInkAnnotation class using the PdfInkAnnotationAppearanceGenerator.UseSmoothing property:

Code: Select all

((PdfInkAnnotationAppearanceGenerator)inkAnnotation.AppearanceGenerator).UseSmoothing = false;
Please use version 9.1.1.3 and let me know if you will have any question or problem.

Best regards, Alexander