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

Question

Question

SDK Script to add a TextBox Annotation

asked on February 10, 2015

Can some one please guide me on how to create a Text Annotation with a SDKScript on Workflow?

I can not use the Activitiy already available in Workflow because I need to add some Comments on the Annotation Metadata.

Thanks,

0 0

Replies

replied on February 10, 2015

David,

Here is an RA code snippet for a Workflow 9.2 SDK Script Activity.  If you are using an earlier version of Workflow and need LFSO versus RA then let me know and I can provide that code. 

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports Laserfiche.RepositoryAccess


Namespace WorkflowActivity.Scripting.AssignTextAnnotation
    '''<summary>
    '''Provides one or more methods that can be run when the workflow scripting activity is performed.
    '''</summary>
    Public Class Script1
        Inherits RAScriptClass92
        '''<summary>
        '''This method is run when the activity is performed.
        '''</summary>
        Protected Overrides Sub Execute()
            'Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
            
            'Make sure that we are working with a document...
            If Me.BoundEntryInfo.EntryType = EntryType.Document Then
                
                'Get a reference to page 1 of the bound entry...
                Dim pInfo As PageInfo = Document.GetDocumentInfo(Me.BoundEntryId, Me.RASession).GetPageInfo(1)
                
                'Create a new TextBoxAnnotation...
                Dim tAnnotation As TextBoxAnnotation = New TextBoxAnnotation
                
                'Set the coordinates (x=40, y=40, width=400, height=70) and other properties...
                tAnnotation.Coordinates = New Laserfiche.RepositoryAccess.Common.LfRectangle(40,40,400,70)
                tAnnotation.Text = "Hello World!"
                tAnnotation.Comment = "I am a new annotation"
                
                'Add the annotation to the page...
                pInfo.AddAnnotation(tAnnotation)
                
                'Cleanup...
                tAnnotation = Nothing
                pInfo = Nothing
                
            End If
            
        End Sub
    End Class
End Namespace

 

1 0
replied on February 10, 2015

David - What version of Workflow?

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

Sign in to reply to this post.