PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 9:30 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Mar 30, 2017 5:24 pm 
Offline

Joined: Thu Mar 30, 2017 4:54 pm
Posts: 2
Hi

i have an image and some text that needs to stay in line. If the text is long, then i need it to line break under the image label. See attached photo (The screenshot is a pdf render, I just used ms paint to edit the screenshot show what I need. )

But my problem is, the image is sitting a bit to high and i want to move it down a bit. How can i accomplish that?

Here is my code:
Code:
          var table = section.AddTable();
          table.AddColumn(Unit.FromInch(7.5));

          Image image;
          var imageTextRow = table.AddRow();
          var imageTextCell = imageTextRow.Cells[0];

          Paragraph logoAndTextParagraph = imageTextCell.AddParagraph();
          image = logoAndTextParagraph.AddImage(@"C:\Users\csabau\Downloads\HcmcPdfSpike\HcmcPdfSpike\Content\labeltest.png");
          logoAndTextParagraph.AddFormattedText(" This is some information. This is some information. This is some information. This is some information. This is some information. This is some   information. This is some information. This is some information. This is some information.  ", _font);
          image.Height = new Unit(12, UnitType.Point);


Attachments:
File comment: Expected vs reality
testPDF_Expected Result.png
testPDF_Expected Result.png [ 99.57 KiB | Viewed 3494 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 01, 2017 6:01 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
Hi!

Images in paragraphs are treated like text and are by default aligned at the baseline of the text.
I don't know if it is possible to move the images down a bit - the Image class has many position options that are worth a try.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 168 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:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group