Annotation properties predefined values

Discussions about DocuVieware integration in GdPicture.NET.
Post Reply
KevinLK
Posts: 15
Joined: Wed Jan 13, 2016 5:08 pm

Annotation properties predefined values

Post by KevinLK » Mon Feb 01, 2016 2:52 pm

Hi

Is there a way, that I can predefine what choice the user has when adding an annotation.

For instance, that the only font options you have are Verdana and Arial or you only have 3 different colour types to chose from?

Thank you in advance

- Kevin

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Annotation properties predefined values

Post by Loïc » Tue Feb 02, 2016 4:10 pm

Hello Kevin,

Sure you can:

- Intercept the AnnotationAddedByUser() event.
- Get the annotation object from the index obtained from the event.
- Cast the annotation object to the appropriated structure.
- Change any property of the annotation.

Please let me know if you need further information. In case you need a code snippet please let me know which language you are using.

With best regards,

Loïc

KevinLK
Posts: 15
Joined: Wed Jan 13, 2016 5:08 pm

Re: Annotation properties predefined values

Post by KevinLK » Wed Feb 03, 2016 9:11 am

Hi Loïc

A code snippet would be awesome, thank you.

Im using C#

Thanks again.

Best regards,
Kevin

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Annotation properties predefined values

Post by Loïc » Thu Feb 04, 2016 8:09 pm

Hello Kevin,

Are you talking about DocuVieware or GdPicture.NET (Winform or WPF ?).

Cheers,

Loïc

KevinLK
Posts: 15
Joined: Wed Jan 13, 2016 5:08 pm

Re: Annotation properties predefined values

Post by KevinLK » Fri Feb 05, 2016 9:30 am

Oh, sorry

DocuVieware

-Kevin

Cedric
Posts: 269
Joined: Sun Sep 02, 2012 7:30 pm

Re: Annotation properties predefined values

Post by Cedric » Fri Feb 05, 2016 5:47 pm

Hello Kevin,

This can easily be done using the JavaScript API client side, as explained here: https://www.gdpicture.com/guides/gdpicture/web ... tions.html

Code: Select all

function addCustomStamp() {
    customStampAppearance = {
        fill: false,
        stroke: false,
        fontStyle: 0,
        foreColor: "#1CA30D",
        opacity: 1,
        text: "Paid by cash",
        alignment: 0,
        lineAlignment: 0
    };
    DocuViewareAPI.AddTextAnnotInteractive("DocuVieware1", customStampAppearance, true, ["fontName","foreColor"]);
}
You can call this customized appearance annotation method from a button for instance (this allows you to implement your own custom annotation palette with the default values you need).
It will result in setting the appearance of the text annotation the user will draw from this button while letting him the choice for font and color only, all the other properties will be missing from the annotation dialog so they can't be modified.

However we currently have no solution to restrict the font or color choices, I have backlogged the request in our project management system for the development team to consider though.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest