PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu May 09, 2024 4:08 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Nov 25, 2008 5:44 pm 
Offline

Joined: Mon Nov 24, 2008 4:42 pm
Posts: 2
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?


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 27, 2008 3:52 pm 
Offline

Joined: Mon Nov 24, 2008 4:42 pm
Posts: 2
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


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 132 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