View previous topic :: View next topic |
Author |
Message |
jbanko
Joined: 24 Nov 2008 Posts: 2
|
Posted: Tue Nov 25, 2008 5:44 pm Post subject: Footer formatting for PageOrientation.Landscape |
|
|
I defined new MigraDoc document m_Doc and added section:
Section sec = m_Doc.AddSection();
Then I created the footer and appropriate paragraph:
HeaderFooter footer = sec.Footers.Primary;
Paragraph footerPara = new Paragraph();
Then I defined paragraph format:
ParagraphFormat pf = new ParagraphFormat(); and set the alignment to:
ParagraphAlignment.Right;
Page definition is:
PdfPage page = docRender.PdfDocument.Pages[0];
page.Size = PageSize.Letter;
While using page.Orientation = PageOrientation.Portrait and
XRect rect = new XRect(new XPoint(0, 0), new XSize(page.Width.Point, (page.Height.Point - 30)));
my footer was aligned to the right, but when I changed to page.Orientation = PageOrientation.Landscape; my ParagraphAlignment.Right; was around the centre.
What would be the proper solution to align to the right for landscape? |
|
Back to top |
|
|
jbanko
Joined: 24 Nov 2008 Posts: 2
|
Posted: Thu Nov 27, 2008 3:52 pm Post subject: Footer formatting for PageOrientation.Landscape |
|
|
I found the way how to resolve the footer formatting issues for landscape orientation:
1. After the footer section definition I defined last section page setup orientation as landscape for my MigraDoc document m_Doc:
m_Doc.LastSection.PageSetup.Orientation = Orientation.Landscape;
2. Then after setting the footer paragraph format I used the default page orientation portrait and the whole .pdf output was rendered with landscape orientation and I have full control over footer paragraph formatting:
page.Orientation = PageOrientation.Portrait;
So if anybody had similar challenge, you may probably use the same idea.
Jan
|
|
Back to top |
|
|
|