PdfInkAnnotation draw with a Bezier curve

Questions, comments and suggestions concerning VintaSoft PDF .NET Plug-in.

Moderator: Alex

Post Reply
IntegraMike
Posts: 51
Joined: Mon Dec 02, 2019 11:19 pm

PdfInkAnnotation draw with a Bezier curve

Post 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!
Alex
Site Admin
Posts: 1942
Joined: Thu Jul 10, 2008 2:21 pm

Re: PdfInkAnnotation draw with a Bezier curve

Post 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
IntegraMike
Posts: 51
Joined: Mon Dec 02, 2019 11:19 pm

Re: PdfInkAnnotation draw with a Bezier curve

Post by IntegraMike »

That sounds great, thank you!
Alex
Site Admin
Posts: 1942
Joined: Thu Jul 10, 2008 2:21 pm

Re: PdfInkAnnotation draw with a Bezier curve

Post 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
Alex
Site Admin
Posts: 1942
Joined: Thu Jul 10, 2008 2:21 pm

Re: PdfInkAnnotation draw with a Bezier curve

Post 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
Post Reply