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

Question

Question

Odd SDK Problem: No Error, and No Annotation Either

asked on July 28, 2023 Show version history

A few years ago we build an RA program to add annotations to Content Manager documents we migrated into Laserfiche.  It worked quite well.

We have a similar migration for Perceptive ImageNow, V7, and dusted the old project off. We reconfigured it for the differences between CM and INOW. 

But, when we go to add the annotation, it does not throw any errors, and it does not add an annotation either. We get a lot of nothing.

For a Text Box, we are setting properties for:

Text, Border Color, Fill Color, Coordinates (X, Y, Height, Width), Text size.

Then we call:

PI.AddAnnotation(Anno)
PI.Save()

'Discard the object
If Not PI Is Nothing Then
   PI = Nothing
End If

PI is a PageInfo object, derived from an Document Info Object.

We can create a text box on the same page through workflow, so this one has us baffled. 

Also the original target page was a greyscale image.  To test the format, I added a B/T tif file as the target page.  This made no difference. 

Are we missing something obvious? TIA

 

 

 

0 0

Replies

replied on July 31, 2023 Show version history

Thanks, Jason -

It looks like we are pretty much using the same methods.

The annotation is created using:

Dim Anno As TextBoxAnnotation = New TextBoxAnnotation

'Then I was setting the coordinates from variables:

Anno.Coordinates = New Laserfiche.RepositoryAccess.Common.LFRectangle(X_Coord, Y_Coord, AnnoWidth, AnnoHeight)

Functionally equivalent. So I decided to try your coordinates, and Bingo! That worked. The issue is not with the syntax, but with the coordinates themselves. 

This did not solve the problem, but you did help identify the log jam.  I owe you one!

Next step in testing:

 

 

 

4 0
replied on July 28, 2023 Show version history

How exactly is the annotation object (Anno) being created?

The following code worked both with and without calling PI.Save(), so I would double check the annotation settings, especially the coordinates.

Anno.Coordinates = New Laserfiche.RepositoryAccess.Common.LfRectangle(50,50,500,80)
Anno.Text = "Text Box"
Anno.Comment = "Test Comment"
Anno.BorderColor = Laserfiche.RepositoryAccess.Common.LfColor.TRANSPARENT
Anno.FillColor = Laserfiche.RepositoryAccess.Common.LfColor.TRANSPARENT

PI.AddAnnotation(Anno)

'Discard
Anno = Nothing
PI = Nothing

 

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

Sign in to reply to this post.