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

Question

Question

Annotation Note is locked for viewing after being created

SDK
asked on June 16, 2014

We are developing custom LF program which has includes a simple Annotation module.

 

The code runs good and creates the annotation, but the annotation is not visible on the page. (see below screen shot)

 

Here is the Annotation snippet,

 

' Retrieves document pages object.

Dim DocPages As LFDocumentPages = Doc.Pages

' Retrieves the first page of the document.

Dim PageOne As LFPage = DocPages.Item(1)

' Get a write lock on the page.

PageOne.LockObject(Lock_Type.LOCK_TYPE_WRITE)

Doc.LockObject(Lock_Type.LOCK_TYPE_WRITE)

Dim sticky2 As LFStampAnnotation = PageOne.AddAnnotation(Annotation_Type.ANN_STAMP)

''sticky2.Import(".\bitmap\" & FileName & ".BMP")

sticky2.Import(".\bitmap\1.bmp")

'' Dim sticky As LFStickyNote = selectedPage.AddStickyNote()

'Save your changes.

PageOne.Update()

Doc.Update()

'Unlock the page.

PageOne.UnlockObject()

Doc.UnlockObject()

Doc.Dispose()

 

Please help us to move forward with this project.

 

 

Annotation.docx (53.95 KB)
0 0

Answer

APPROVED ANSWER
replied on June 17, 2014

The maximum stamp image size is 127kB (131070 bytes), the stamp you attached is slightly larger than that. I tried importing it myself and the server rejects it with "The bitmap data exceeds the maximum size"

1 0

Replies

replied on June 16, 2014

Maybe the stamp you are importing can't be displayed, does it work if you use APPROVED.BMP from ProgramFiles\Laserfiche\Client?

1 0
replied on June 16, 2014

Hi Robert, 

Yes the APPROVD.BMP from ProgramFiles\Laserfiche\Client\ works.

But the private BMP files not showing on the page.

Is there any format or size do we I have to follow?

 

Here is the code again,

 

 ' Retrieves document pages object.
                            Dim DocPages As LFDocumentPages = Doc.Pages
                            ' Retrieves the first page of the document.
                            Dim PageOne As LFPage = DocPages.Item(1)
                            ' Get a write lock on the page.
                            PageOne.LockObject(Lock_Type.LOCK_TYPE_WRITE)
                            Doc.LockObject(Lock_Type.LOCK_TYPE_WRITE)
                            Dim studStamp As LFStampAnnotation = PageOne.AddAnnotation(Annotation_Type.ANN_STAMP)
                            studStamp.Import("./bitmap/" & FileName & ".BMP") 'The BMP file is created using Template feld value
                            'Save your changes.
                            PageOne.Update()
                            Doc.Update()
                            'Unlock the page.
                            PageOne.UnlockObject()
                            Doc.UnlockObject()
                            Doc.Dispose()

0 0
replied on June 16, 2014

The only limit I'm aware of is that it has to be under 512 kb.  Are you sure your bitmap isn't empty?  Can you attach it?

1 1
replied on June 17, 2014

Here is the BMP file on this link, https://drive.google.com/file/d/0B22nB4mGoaMfZ3ZHLWpnaXBuZ3M/edit?usp=sharing

(seems we can't directly upload .bmp files here in LF Answers)

 

Brain, the APPROVED.BMP file is in 5kb size and/1bit depth, mine is 132kb/32bit depth..  does the bit-depth play something here?

 

I also tried 2kb/24bit bit depth BMPs.. but still no luck.

 

Your thoughts please...

 

Thank you for your support sir.

0 0
APPROVED ANSWER
replied on June 17, 2014

The maximum stamp image size is 127kB (131070 bytes), the stamp you attached is slightly larger than that. I tried importing it myself and the server rejects it with "The bitmap data exceeds the maximum size"

1 0
replied on June 17, 2014

With that bmp I get an exception thrown "The bitmap data exceeds the maximum size".  Do you not get that error?

The bitmap seems to be below the limit, so I'm not exactly sure what's wrong with it.  If I save that bitmap as just 1 bit per pixel I can add it without a problem.

1 0
replied on June 17, 2014 Show version history

If you go to the client help file and open "Annotations - Stamps - Creating a Stamp" you will find this paragraph:

To create an image stamp, you first need to create a monochrome Windows bitmap image file (.bmp). If the image contains color, or is in a different file format, it will not be compatible. To make it compatible, open the file in Microsoft Paint (or a similar program), click Save As, and choose Monochrome bitmap.

 

So not only does the bitmap need to be under 64kb, but it must be 1bit depth (monochrome)

1 0
replied on June 17, 2014

Thanks Brain, I already tried with 5KB /24bit BMPs, but same issue.

 

I think, I should make the BMPs in 1bit per pixel, i am trying that out.  I will let you know how it go.

 

Actually the code imports the BMP, but its not visible.  (see the attached)

 

annotation-private-stamp.png
0 0
replied on June 23, 2014 Show version history

Well, here is the 1bit BMP sample created by my program,

https://drive.google.com/file/d/0B22nB4mGoaMfTTNHeDdSbTEtdzQ/edit?usp=sharing

 

But the LF code still doesn't stamp this 1bit image on the page,

 

Code here:

Dim Doc As LFDocument = DB.GetEntryByID(39314)
        ' Retrieves document pages object.
        Dim DocPages As LFDocumentPages = Doc.Pages
        ' Retrieves the first page of the document.
        Dim PageOne As LFPage = DocPages.Item(1)
        ' Get a write lock on the page.
        PageOne.LockObject(Lock_Type.LOCK_TYPE_WRITE)
        Doc.LockObject(Lock_Type.LOCK_TYPE_WRITE)
        Dim studStamp As LFStampAnnotation = PageOne.AddAnnotation(Annotation_Type.ANN_STAMP)
        studStamp.Import("./bitmap/ABBE JOSEPH IEP-1.BMP")
        'Save your changes.
        PageOne.Update()
        Doc.Update()
        'Unlock the page.
        PageOne.UnlockObject()
        Doc.UnlockObject()
        Doc.Dispose()

 

But same code works good with APPROVED.BMP

 

Please help whats wrong with the BMP again?

 

Thanks in advance for your help

 

Ram

 

 

0 0
replied on June 23, 2014

You can see the comparison here between the LF public stamp and my stamp details. (see attached please)

BMP bit depth.png
0 0
replied on June 23, 2014

I am not sure about the bit depth in the properties, but when you open your image in MS Paint, the color pallet is still not monochrome.  You need to create a monochrome bmp file.

0 0
replied on June 23, 2014

Oh ok, Makes sense Bert.  I will try it.

0 0
replied on June 23, 2014

Bert, Yes the monochrome works perfectly!.. Thank you so much for your help.

Really appreciate it sir.

 

0 0
replied on June 16, 2014

Unfortunately we are not using a stamp.  We are trying to add a sticky note and append data from a template field.

0 0
replied on June 16, 2014 Show version history

Your line of code:

Dim sticky2 As LFStampAnnotation = PageOne.AddAnnotation(Annotation_Type.ANN_STAMP)

adds a stamp, not a sticky note.  The variable name is misleading.

 

If you want to add a sticky note, you have to change the type of the 'sticky2' variable and change the enumeration value you use here.  In the case of a sticky note, the Import call immediately following will no longer be necessary.

1 0
replied on June 16, 2014

Sorry the variable  "sticky2" mislead you.   Actually we are trying to stamp private BMP image.  The problem is the annotation is being created but some reason its locked for viewing. 

0 0
replied on June 16, 2014

ok I spoke with the programmer and I had some misunderstanding of the project.  The current issue is that the stamp is being created but it's locked from being viewed.  This is what they are trying to figure out.  Thank you for your help and support.

 

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

Sign in to reply to this post.