PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Tue Dec 09, 2025 7:44 pm

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  [ 2 posts ] 
Author Message
PostPosted: Thu Oct 11, 2012 3:34 am 
Offline

Joined: Thu Oct 04, 2012 4:46 am
Posts: 10
Thanks for thoughts

I am currently using:
Code:
Unit usableWidth = Unit.FromMillimeter(doc.DefaultPageSetup.PageWidth.Millimeter - doc.DefaultPageSetup.LeftMargin.Millimeter - doc.DefaultPageSetup.RightMargin.Millimeter);


to put tab stops at the right hand border of paragraphs (including header and footer paragraphs), in order to account for different page orientations.

This works as expected , but I was wondering if there is an inbuilt property of a section or paragraph object to give this info.

I am also being lazy in not downloading/looking at the c-sharp, but what is the "baseline" units of migradoc - in calculations like above it would seem to make most sense to use these rather than converting back and forward to mm.

Thank you for time and thoughts


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 11, 2012 8:23 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3139
Location: Cologne, Germany
Hi!
Mcshaz wrote:
in calculations like above it would seem to make most sense to use these rather than converting back and forward to mm.
Unit remembers the type millimeter and the exact value, so no rounding occurs if you do calculations with millimeters - since the default page setup uses metric values (specified using centimeters, but the conversion with factor 10 shouldn't make a difference).

If you set your own page size and margins using inches, then better make calculations in inch.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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: No registered users and 399 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