| PDFsharp & MigraDoc Forum https://forum.pdfsharp.net/ |
|
| Efficient tab at right of usable paragraph width https://forum.pdfsharp.net/viewtopic.php?f=2&t=2164 |
Page 1 of 1 |
| Author: | Mcshaz [ Thu Oct 11, 2012 3:34 am ] |
| Post subject: | Efficient tab at right of usable paragraph width |
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 |
|
| Author: | Thomas Hoevel [ Thu Oct 11, 2012 8:23 am ] |
| Post subject: | Re: Efficient tab at right of usable paragraph width |
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. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|