PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Mar 29, 2024 2:10 pm

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: Thu Jan 13, 2011 9:34 pm 
Offline

Joined: Thu Jan 13, 2011 8:30 pm
Posts: 1
I'm new to MigraDoc and have picked up the maintenance of an existing application that has suddenly started printing the header logo on all of the pages instead of only the first. I have set the DifferentFirstPageHeaderFooter flag to True and when I do that the logo disappears from the first page and is still on all preceding pages.

Thanks
Chuck


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 22, 2011 1:25 pm 
Offline

Joined: Tue Feb 22, 2011 1:18 pm
Posts: 1
Location: Middlesbrough, UK
Hi, I too was having the same problem. All I did to solve this was:

// Set the DifferentFirstPageHeaderFooter.
document.DefaultPageSetup.DifferentFirstPageHeaderFooter = true;


I then change the following line:
From: var myImage = section.Headers.Primary.AddImage("ImageLocation");
To: var myImage = section.Headers.FirstPage.AddImage("ImageLocation");


// E.g. Add the image to the document's first page.
var myImage = section.Headers.FirstPage.AddImage("ImageLocation");
myImage.Height = "2.5cm";
myImage.LockAspectRatio = true;
myImage.RelativeVertical = RelativeVertical.Line;
myImage.RelativeHorizontal = RelativeHorizontal.Margin;
myImage.Top = ShapePosition.Top;
myImage.Left = ShapePosition.Right;
myImage.WrapFormat.Style = WrapStyle.Through;

_________________
John Hodkinson
Software Engineer
Thap Ltd.


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