Programmatically create an annotation and burn into the imag

Document Imaging SDK,
Image SDK,
TIFF SDK,
Annotation SDK,
Cover Page Generator

Moderator: Technical Support Team

Programmatically create an annotation and burn into the imag

Postby lcody0108 » Thu Feb 07, 2013 2:27 pm

i am trying to create an annotation within my dll and burn into the image (a one page tiff file). After executing this code, nothing shows up on the page. What step am I missing?

Code: Select all
BITIFFLib.BITiff objTiff = new BITIFFLib.BITiff();
BIANNOLib.BiAnno objAnno = new BIANNOLib.BiAnno();
BIDIB objDib = new BIDIB();
long dib = 0;
//get the dib
dib = objTiff.LoadTiffIntoDIB(sDocumentFile, 0, false);


//create the annotation object
objAnno.CreateAnnoObj(Convert.ToInt16(BIANNOLib.ObjectType.aotText));
objAnno.AnnoObjSetPos(10, 10);
objAnno.AnnoObjSetSize(138,166);
                   
                    //set the background color
                    objAnno.AnnoObjSetBKColor(Convert.ToInt16(Color.Purple.R), Convert.ToInt16(Color.Purple.G), Convert.ToInt16(Color.Purple.B));
                    //set the foreground color?
                    objAnno.AnnoObjSetColor(Convert.ToInt32(BIANNOLib.Color.acoBlack));
                    //set the text
                    objAnno.AnnoObjSetText("Test Data");
                    //set the font properties
                    objAnno.AnnoObjSetFont(100, 50, 0, 0, 100, false, false, false, 0,0,0,0,0, "Arial");


                    //rotate the object
                    objAnno.AnnoRotateObj270();
                         
                    objAnno.AnnoSetDPI(dib);

                    // Set page size
                    objAnno.AnnoUISetExtent(objDib.GetDIBWidth(dib), objDib.GetDIBHeight(dib));

                    objAnno.AnnoSelectPage(0);
dib = objAnno.AnnoBurnin(dib);
objTiff.InsertTiffImage(sDocumentFile, dib, Convert.ToInt16(enumCompressionModes.imgcmCcittG4), false, 1, 0, false, true);
lcody0108
 
Posts: 3
Joined: Fri Sep 17, 2010 12:31 pm

Re: Programmatically create an annotation and burn into the

Postby lcody0108 » Thu Feb 14, 2013 2:09 pm

Okay changed the following items and viola!

1. Creating a Text object so I tried AnnoOrientationObjFont270 as opposed to AnnoRotateObj270
2. pass the AnnoObjSetSize method the height, width when rotating as opposed to Width, Height

That worked for me, otherwise, it looked like the pivot point changed to right of the edge of the page, so nothing showed up on the document.
lcody0108
 
Posts: 3
Joined: Fri Sep 17, 2010 12:31 pm

Re: Programmatically create an annotation and burn into the

Postby Atommefear » Fri Jan 30, 2015 5:10 am

It was good advice, but I like it.
Atommefear
 
Posts: 2
Joined: Fri Jan 30, 2015 2:34 am


Return to Imaging Toolkits



Who is online

Users browsing this forum: No registered users and 1 guest

cron