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

Question

Question

Pesronal Stamps list using SDK

asked on July 24, 2015 Show version history

I have a script which gets the list of Personal Stamps and apply the appropriate one to the image. This code works fine for two of the stamps (Laserfiche User and Salah Hassan in the screenshot below) but doesn't work for any other. 

         

StampInfoReader ListOfStamps = Stamp.EnumPersonalStamps(mySess);

foreach (StampInfo SI in ListOfStamps)
            {
                MsgBox("Name: " + SI.Name);
            if (SI.Name == "Khamis")
            {
               MsgBox("Stamp Found");
            }
            }

 

 

I wrote this code a while ago, so I am just curious if 'Adding Personal Stamp' was the right way to define a stamp, which could be used/accessed using Code in workflow.

If I change the name of the Personal Stamp e.g Laserfiche User 1, I can still access the Stamp of name 'Laserfiche User', which actually means that this is not the right way/place of defining stamps (which could be accessed by WF).

0 0

Replies

replied on August 3, 2015

Personal stamps are tied to a particular user, so WF wouldn't have access to a different user's personal stamps. 

 

Try using one-time stamps instead, you can use the Laserfiche.DocumentServices.StampBitmapConverter class to import a file as a new stamp annotation:

DocumentInfo doc = Document.GetDocumentInfo(docId, session);
PageInfo page = doc.GetPageInfo(1);
using (Bitmap bmp = new Bitmap(filename))
using (MemoryStream bmpData = new MemoryStream())
{
    bmp.Save(bmpData, ImageFormat.Bmp);
    System.Windows.Media.Imaging.BitmapDecoder decoder = BitmapDecoder.Create(bmpData, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad);
    byte[] bmpBody = Laserfiche.DocumentServices.StampBitmapConverter.GetStampImageData(decoder.Frames[0]);

    StampAnnotation stampAnn = new StampAnnotation(doc, page.PageNumber, bmpBody, bmp.Width, bmp.Height);
    stampAnn.Position = new LfPoint(100, 100);
    page.AddAnnotation(stampAnn);
    page.Save()
}

 

1 0
replied on August 3, 2015

Any suggestion from the Laserfiche Gurus!

This has stopped my dev progress now sad

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

Sign in to reply to this post.