| PDFsharp & MigraDoc Forum https://forum.pdfsharp.net/ |
|
| textframe in header - avoiding section content overlapping. https://forum.pdfsharp.net/viewtopic.php?f=2&t=2161 |
Page 1 of 1 |
| Author: | Mcshaz [ Fri Oct 05, 2012 5:42 am ] |
| Post subject: | textframe in header - avoiding section content overlapping. |
I am new to this forum, but I am really liking migradoc's API. So far it seems like a great piece of software. Thank you for all help while I go through teething problems. I am creating a PDF with a list of drug doses, calculated according to a patients weight and age. The header consists of 2 components -a paragraph containing the date the document was created, and 2 textframes sitting just below this paragraph (one to the left and one to the right of the page) - 1 to affix the patient identification sticker, and another for confirmation signatures, both added with: Code: Paragraph para = section.Headers.Primary.AddParagraph(); TextFrame ptSticker = section.Headers.Primary.AddTextFrame(); the issue is that while the paragraph component takes up physical space, so each pages content starts below this, the textframes are absolutely positioned (to use html terminology) and thus the textframe content completely overlaps the content added with Code: section.AddParagraph(); I could 'Hack' it, but what is a good solution to ensure each pages content starts below the iframe (including when content flows onto a new page and the header is repeated) thank you |
|
| Author: | () => true [ Sun Oct 07, 2012 6:25 am ] |
| Post subject: | Re: textframe in header - avoiding section content overlappi |
Hi! Set page margins to take care of the reserved area at the top. PageSetup can be different for every section. See this post showing how to set the bottom margin: viewtopic.php?p=3085#p3085 |
|
| Author: | Mcshaz [ Sun Oct 07, 2012 10:17 am ] |
| Post subject: | Re: Migradoc footer overflowed by table |
Thanks for your reply - By setting the page margin I am half way there in terms of - the page content begins below the left textframe. this textframe is appropriately positioned below the header paragraph above when using ptSticker.RelativeVertical = RelativeVertical.Paragraph; however, whether using RelativeVertical.Paragraph or RelativeVertical.Line, the right hand textframe begins with its top at the bottom margin of the left textframe (ie the previously defined element, which makes sense for the line option, but less so for the paragraph option). If using RelativeVertical.Margins, of course the textframes are still overlapping the page content (just the textframes and page content are pushed lower down by specifying the greater PageSetup.TopMargin). If setting RelativeVertical.Page, the textframes are at the very top of the page (ie the edge of the paper), and if using relativeVertical.Page with enough top margin to clear the 1st header paragraph, the text moves down appropriately, but the textframe border remains steadfastly attached to the very top of the page (for those of us familiar with html it is like setting the padding grater than the element height with overflow visible) Thanks for any help with this element alignment problem. |
|
| Author: | Thomas Hoevel [ Mon Oct 08, 2012 7:34 am ] |
| Post subject: | Re: textframe in header - avoiding section content overlappi |
Hi! When using RelativePage, set the position using textFrame.WrapFormat.DistanceTop as shown here: viewtopic.php?p=6141#p6141 |
|
| Author: | Mcshaz [ Thu Oct 11, 2012 1:01 am ] |
| Post subject: | Re: textframe in header - avoiding section content overlappi |
Thank you very much - works beautifully |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|