PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 11:58 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Feb 17, 2019 2:12 pm 
Offline

Joined: Sun Feb 17, 2019 2:04 pm
Posts: 2
Hi all,
I'm not able to reproduce the layout shown in the picture (borders shown only for clarity). I have an address which must be left aligned, but it should be always aligned "as a frame" to the right of the page, e.g. its longest line must finish exactly at the right edge of the page. In the picture there are three examples; every address is left aligned but it starts at a different point.

Should I calculate exactly how long my text would be and then create a text frame or column with the calculated width? It seems too complicated, maybe I don't know some alignment options.

Thanks in advance,
David


Attachments:
migradoc.jpg
migradoc.jpg [ 52.86 KiB | Viewed 3581 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 17, 2019 3:20 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 906
Location: CCAA
Hi!
fradax wrote:
Should I calculate exactly how long my text would be and then create a text frame or column with the calculated width?
That's the way to do it.
There is no "Auto" width with MigraDoc.

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


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 17, 2019 5:05 pm 
Offline

Joined: Sun Feb 17, 2019 2:04 pm
Posts: 2
TH-Soft wrote:
Hi!
fradax wrote:
Should I calculate exactly how long my text would be and then create a text frame or column with the calculated width?
That's the way to do it.
There is no "Auto" width with MigraDoc.


Thanks, so the only way is to include the TextMeasurement class you provided in this topic: viewtopic.php?f=8&t=3196. Right?


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 17, 2019 7:57 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 906
Location: CCAA
fradax wrote:
Thanks, so the only way is to include the TextMeasurement class you provided in this topic: viewtopic.php?f=8&t=3196. Right?
That would be my approach.
Simple if there only is one style per line. Things will become more difficult if you mix several styles (e.g. regular and bold), different fonts or font sizes in one of those lines.

_________________
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  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 43 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