PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed May 23, 2018 6:37 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Jan 18, 2018 12:10 pm 
Offline

Joined: Tue Jan 16, 2018 10:21 am
Posts: 8
Hi all

In my document I need to have a header and footer which includes rather much information (settings). I want touse the header on all pages so I use the Section.Headers.Primary for this but my header differs a bit from page 1 to the rest of the pages. Actually the footer is quite the same on all pages, but on page 1 I want to have an address and no pagenumber and on the other pages I need a pagenumber and no address.

Could I use the property for this?

Otherwise I suppose I could create aparagraph holding the address, but I only want that paragraph to be printet/visible on page 1. Can that be achieved?

Best regards
Tomo


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 18, 2018 1:27 pm 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2815
Location: Cologne, Germany
Hi!

There are three header you can set. There is an extra header for the first page, so it is easy to have a different header on the first page.
You can also set a header for even pages if you need different headers for odd and even pages.

Same for the footers.

So in your case (as I understand your requirements), just set the primary header and the first page header.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 18, 2018 1:40 pm 
Offline

Joined: Tue Jan 16, 2018 10:21 am
Posts: 8
Hi Thomas

Yes, actually that was what I was going to do. As I wrote in my question the header information contains rather much information in terms of paragraphs a.o.

Do I have to define these paragraphs both for the FirstPage header and for the Primary header (for those paragraphs that have to be on both headers) or is it possible to re-use the definitions?

/Tomo


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 18, 2018 2:19 pm 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2815
Location: Cologne, Germany
You can add a paragraph to one header and add a "Clone()" of that paragraph to another header.
Or simply make a method that creates the paragraphs and call it twice.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 19, 2018 10:21 am 
Offline

Joined: Tue Jan 16, 2018 10:21 am
Posts: 8
Hi Thomas

Okay, yes - I don't quite understand the Clone function so I went for the function solution. Works fine.

I have 2 issue left with my invoice. I wonder if you can help me solving these. I have attached a copy of the invoice (draft).

First issue concerns the first row in the table showing the invoice items. On first page there has to be a higher row 1 containing specific information. I have managed to create that just by setting the rowheight for this to a specific value. The other rows are having another height. However, if the number of invoice items causes the invoice to continue om page 2, I don't want the heigh row 1 in the table on the subsequent pages. The invoice table should just continue with "normal" lines. I can't figure out how to control this. I have tried using a variable which will be true only for the first line in the table FillInvoice table method - after the first row the variable is false. Nevertheless, the heigh row including the content is printet on all pages. How can that be and how to solve this?

Second issue concerns the footer. The footer is a table with 4 columns and 2 rows. Normally is should not print the borders but I have added the borders for better showing my problem. Row 1, Column 1 is printed in 2 lines which also goes for row 1, column 4 and row 2, column 4. I don't want 2 lines but only 1. Setting the fontsize to 4 I can manage to get the row 1, column 1 in one line but not for column 4. There seems to be more than enough space to print the data in just one line so why doesn't it do that? How can achieve this?

Hope you are able to help me.

Trying to upload a file fails. Can I email you a copy of the pdf-file if you would like to se it?

Best regards
Torben Mortensen


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 4 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:  
Powered by phpBB® Forum Software © phpBB Group