PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Placing image above text
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1797
Page 1 of 1

Author:  Testl [ Thu Sep 29, 2011 10:31 am ]
Post subject:  Placing image above text

Greetings everyone.
I got some troubles with placing picture above text.
I need to place it after a text block, which placed after a table. And in my programm I don`t know size of the table and size of the text. Like on the picture:Image
I can`t place it with gfx.DrawImage because i don`t know exactly it coords.
And I can`t place it with section.AddImage because it only wraps text or place text above.
Have you any ideas how can i achieve it?
Can I obtain specified text block coords? Or can I do it with MigraDoc?

p.s. sorry for my english

Author:  Thomas Hoevel [ Thu Sep 29, 2011 12:35 pm ]
Post subject:  Re: Placing image above text

You can use AddImage for that purpose.
Add code like
Code:
img.WrapFormat.Style = WrapStyle.Through;

and the text layouter will ignore the image.

Using code like
Code:
img.RelativeHorizontal = RelativeHorizontal.Column;
img.RelativeVertical = RelativeVertical.Line;

you can specify the image position relative to the position where you called AddImage.

See also:
viewtopic.php?f=2&t=1506&p=4370&hilit=WrapStyle.%2A#p4370
viewtopic.php?p=1050#p1050

Author:  Testl [ Thu Sep 29, 2011 4:31 pm ]
Post subject:  Re: Placing image above text

Thank you, Thomas.
But I got something like this:
Image
The text is above image. But I don`t need a background.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/