Annotation properties predefined values
Annotation properties predefined values
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
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
Re: Annotation properties predefined values
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
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
Re: Annotation properties predefined values
Hi Loïc
A code snippet would be awesome, thank you.
Im using C#
Thanks again.
Best regards,
Kevin
A code snippet would be awesome, thank you.
Im using C#
Thanks again.
Best regards,
Kevin
Re: Annotation properties predefined values
Hello Kevin,
Are you talking about DocuVieware or GdPicture.NET (Winform or WPF ?).
Cheers,
Loïc
Are you talking about DocuVieware or GdPicture.NET (Winform or WPF ?).
Cheers,
Loïc
Re: Annotation properties predefined values
Oh, sorry
DocuVieware
-Kevin
DocuVieware
-Kevin
Re: Annotation properties predefined values
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
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.
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"]);
}
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.
Who is online
Users browsing this forum: No registered users and 2 guests