PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Wed Nov 05, 2025 2:51 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Aug 30, 2013 7:55 pm 
Offline

Joined: Fri Aug 30, 2013 7:17 pm
Posts: 2
Hi

I'm trying to place an image in a paragraph. But I seem to not be able to position the image where I would like to

Here is the code:

Code:
Paragraph paragraph = m_document.LastSection.AddParagraph();
FormattedText formattedText = paragraph.AddFormattedText(textstring);
Image image = paragraph.AddImage(imageFileName);
image.Width = "1cm";
image.RelativeVertical = RelativeVertical.Line;
image.Top = ShapePosition.Center;
image.Left = ShapePosition.Left;


That is the result:

Attachment:
File comment: This is what I get
actual.jpg
actual.jpg [ 10.87 KiB | Viewed 8400 times ]


Here is what I would like to have:

Attachment:
File comment: The goal
goal.jpg
goal.jpg [ 11 KiB | Viewed 8400 times ]


I searched for infos. I tried different variations of the RelativeHorizontal, RelativeVertical, ShapePosition, WrapFormat.Style. But the images are always aligned with the bottom of the text.

What am I not getting? What am I not doing right?

Best regards
Hans


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 02, 2013 5:01 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3136
Location: Cologne, Germany
I would use a table with two columns, one column for the text, one column for the images.

See also:
viewtopic.php?p=7212#p7212

You can use tables without borders, so you would get what you want.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 04, 2013 5:34 pm 
Offline

Joined: Fri Aug 30, 2013 7:17 pm
Posts: 2
Thank you for your answer.

Regards,
Hans


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 149 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group