Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, June 2, 2013 5:52:26 AM(UTC)
wangbill18

Groups: Registered
Posts: 50


Hi James,

How to add then burn annotations for multi-page document? Each page has its own annotations. For example, page no stamp. I have used the code in your link with one page image for a while. But I can't figure out for muti-page. Someone said that requires one AnnContainer for each page.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, June 3, 2013 4:41:14 AM(UTC)

mohamed  
mohamed

Groups: Registered, Tech Support
Posts: 179


Our moderator has split your post to a new thread.

The main idea is to loop on all image pages, and on each page load the related annotation file then burn it to the image.
I have modified the project to load Multipage tiff and burn the same annotation file on all pages.
In your case, you may need to change the annotation file for each page since you said each page has its own annotation.
File Attachment(s):
NET-v17.5-Load-BurnAnnotations-WithoutRasImgVwr.zip (1,224kb) downloaded 86 time(s).
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Thursday, June 6, 2013 6:06:15 AM(UTC)
wangbill18

Groups: Registered
Posts: 50


Thanks for the code. I can use it as my last resort. What I am looking for also is the ability to be able adjust stamp position for each page. so Add and Burn will be seperate operation. Is that doable? Thanks!
 
#4 Posted : Friday, June 7, 2013 7:38:12 AM(UTC)
wangbill18

Groups: Registered
Posts: 50


I realized my 2nd post is deviating from the subject in terms of "Without viewer". To be able to adjust annotation position by user, viewer has to be used. I will rephrase my question. Can this be done? Showing multi-page image on RasterImage viewer, then let user add text stamp on each page, user can adjust the stamp content and position for each page. once user is happy with all stamps on all pages, user will burn the stamps into the images. I hope this is clear. Thanks.
 
#5 Posted : Sunday, June 9, 2013 4:56:32 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

I am attaching a small C# 2010 project that shows how you can load\view a multipage TIFF image, draw text annotations on each page, burn these objects and then save the result to a separate file.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
File Attachment(s):
CsBurnAnn175.zip (1,219kb) downloaded 72 time(s).
 
#6 Posted : Sunday, June 9, 2013 10:22:52 AM(UTC)
wangbill18

Groups: Registered
Posts: 50


Thanks!! I am getting close with your code. But I am not familar with AnnAutomatiom. How to add a Text stamp once the button "Draw Text" is clicked? With your code, user has to click where stamp is needed to be added. I have a AnnTextObject defined already with position and text etc. Can it be added once "Draw Text" is clicked?
 
#7 Posted : Sunday, June 9, 2013 11:19:04 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

I modified the project so that the user can draw the annotation text object directly after clicking the "Draw Text" button.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
File Attachment(s):
CsBurnAnn175_2.zip (1,202kb) downloaded 54 time(s).
 
#8 Posted : Monday, June 10, 2013 3:29:22 AM(UTC)
wangbill18

Groups: Registered
Posts: 50


Hi Maen, Sorry to bug you even more. Is it possible to add page no stamp for all pages when "Draw Text" button is clicked only once? I guess I can combine code of Draw Text, Click Next then Draw Text, click Next, etc.. But I am not sure if that is going work or that is ideal way.
 
#9 Posted : Monday, June 10, 2013 4:27:36 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

You need to change the code of the "Draw Text" button as follows:
+---------------+
private void button1_Click(object sender, EventArgs e)
{
for (int i = 1; i <= rasterImageViewer1.Image.PageCount; i++)
{
rasterImageViewer1.Image.Page = i;

if (annAuto1.Container.Objects.Count > 0)
annAuto1.Container.Objects.Clear();

AnnTextObject TextObject = new AnnTextObject();
TextObject.Pen = new AnnPen(Color.Red, new AnnLength(3));
TextObject.TextColor = Color.White;
TextObject.Text = "Page:" + rasterImageViewer1.Image.Page.ToString();
TextObject.Brush = null;
TextObject.Font = new AnnFont("Arial", new AnnLength(10, AnnUnit.Point), FontStyle.Regular);
TextObject.EdgeMargin = AnnLength.Empty;
TextObject.Alignment = StringAlignment.Center;
TextObject.LineAlignment = StringAlignment.Center;
TextObject.TextRotate = AnnTextRotate.Rotate0;
TextObject.Bounds = new AnnRectangle(rasterImageViewer1.Image.Width / 2, rasterImageViewer1.Image.Height - 100, 90, 90, AnnUnit.Pixel);

annAuto1.Container.Objects.Add(TextObject);

SaveAnn(sender, e);

rasterImageViewer1.Refresh();
}         
}
+---------------+

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#10 Posted : Sunday, June 16, 2013 10:37:05 AM(UTC)
wangbill18

Groups: Registered
Posts: 50


Thanks for help! I used your code and then changed to use one memorystream per page. That worked well for my purpose.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.227 seconds.