You are viewing limited content. For full access, please sign in.

Question

Question

Workflow SDK script activity and how to add a text box annotation to a page

asked on June 28, 2017

Hello Everyone,

I need some help writing an SDK Script that will allow workflow to add a text box. I know there is an activity for this, however the activity does not give me the option to manually assign the text box height and width. According to Laserfiche this is possible to do with the SDK. Please and thank you. 

0 0

Answer

SELECTED ANSWER
replied on June 29, 2017

Hi Matthew,

 

To clarify, you're looking to make the height and width larger than auto sizing to the text? The built-in activity can set x/y locations but you're right, it doesn't do sizing independent of supplied text.

To use the SDK, the property you are looking for is the coordinates property of the TextBoxAnnotation type.

 

DocumentInfo myDoc = Document.GetDocumentInfo(this.BoundEntryId, this.RASession);
PageInfo page = doc.GetPagesInfo(1); // getting page #1 of the document passed to the workflow script

TextBoxAnnotation myTBA = new TextBoxAnnotation();
myTBA.Text = "Text displayed in the annotation";
myTBA.Comment = "Appears in metadata pane describing the annotation";
myTBA.BorderColor = LfColor.TRANSPARENT;
myTBA.FillColor = LfColor.TRANSPARENT;
myTBA.TextSize = 12; // Size of the text within the annotation
myTBA.BorderThickness = 0; // Setting no border
LfSize mySize = new LfSize(100,30); // THIS sets the size of the annotation in pixels.
LfPoint myPoint = new LfPoint(300,200); // This is an x, y coordinate where it will position the annotation to the document. Referenced by the upper left corner of the annotation.
myTBA.Coordinates = new LfRectangle(myPoint, mySize); //Applies the annotation to the page according to specified size and positioned at the specified point

page.AddAnnotation(myTBA); //Adds the created annotation to the specified page from line2

Cheers,

Carl

0 0

Replies

replied on June 29, 2017

Carl,

Thank you for your response. I want to be able to manually assign the textbox a size. I can use this script in SDK Script activity of workflow, correct?

0 0
replied on June 29, 2017

Correct.

 

The size gets manually created on line 11 and then assigned as a part of line 13. It makes use of the Laserfiche SDK RepositoryAccess libraries.

 

 

0 0
replied on June 29, 2017

Carl,

Awesome thank you I appreciate the help!!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.