PDA

View Full Version : Place image at the same position in every page?


Ebh_Finans
December 12, 2006, 13:03:45
Hello,

I have a problem placing some images, at the same position on every pages in my document.

I am currently running with the trial version, but i am sure to buy the product if i can solve this problem.

Do anyone know how to iterate the pages and place images at the same position ?

I tried to do this without any luck, i places the pictures must higher on the second page:

for (int i = 1; i <= textControl.Pages; i++)
{
InsertImage(linepath, 11500, 14000 * i, 4, 100);
InsertImage(linepath, 11500, 14100 * i, 4, 100);
InsertImage(linepath, 11500, 14600 * i, 4, 100);
InsertImage(linepath, 11500, 13700 * i, 4, 100);
}

private void InsertImage(string PicturePath, int x, int y, int ExportFilter, int ExportQuality)
{
TXTextControl.Image image = new TXTextControl.Image();
image.FileName = PicturePath;
image.ExportFilterIndex = ExportFilter;
image.ExportCompressionQuality = ExportQuality;
textControl.Images.Add(image, new Point(x, y), ImageInsertionMode.DisplaceText);
}

/Martin

Gunnar Giffey
December 12, 2006, 15:54:31
Hi Martin,

You could use this overload to specify the page where you want to insert the image:
Add(Image image, int page, Point location, ImageInsertionMode insertionMode);
Please note that the image will be anchored to the page and will not move if you insert text.

Ebh_Finans
December 13, 2006, 08:36:13
Thanks,

That solved the problem.

I also found another way to solve it, but your solution is much better.

/Martin