PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon May 13, 2024 12:10 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed Jan 23, 2013 3:01 pm 
Offline

Joined: Wed Jan 23, 2013 12:25 pm
Posts: 6
Hi,

I am trying to create a invoice with Migradoc.

I want to achive, that after the first page only some of the elements to be transfered to the second page, some not.

For example, on the first page I want some kind of header, on the second not.

But, if a table goes over two pages, I don't want the table to start from top of the page.
If on the fist page was a header, I don't want the header on the second one. But the space, where the header was on the fist site should stay free on the second and the table should start right after the space.

I'm not sure if somebody can understand what I have written, but i try it anyway.

Can somebody please give me a hint how to solve this?

Thank you in advance,
Oliver


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 23, 2013 4:30 pm 
Offline
PDFsharp Guru
User avatar

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

If a table breaks to a new page, it starts at the top of the new page. But you set the page margins, so "top" can be "12cm" or whatever you need.
I'm afraid I do not fully understand what you need. There are some limitations in MigraDoc (e.g. a section can have only one page setup), but typically needs are covered.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 24, 2013 8:29 am 
Offline

Joined: Wed Jan 23, 2013 12:25 pm
Posts: 6
Hi Thomas,

thank you for your help.
I try to make it simpler.

I have an address frame.
The frame should be displayed on every page at the same position.

Is there a property I can set for that?

Thank you
Oliver

Thomas Hoevel wrote:
Hi!

If a table breaks to a new page, it starts at the top of the new page. But you set the page margins, so "top" can be "12cm" or whatever you need.
I'm afraid I do not fully understand what you need. There are some limitations in MigraDoc (e.g. a section can have only one page setup), but typically needs are covered.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 24, 2013 9:55 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3097
Location: Cologne, Germany
Add the address frame to the header and it will show on every page.

Adjust page margins to prevent tables from overlapping this address frame.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 24, 2013 10:06 am 
Offline

Joined: Wed Jan 23, 2013 12:25 pm
Posts: 6
Hi Thomas,

thank you for your help again.

Address to the header worked.

Page numbers:
Did I understand that correct?

Code:
            //Hier muss gemacht werden, was auf allen Seiten sichtbar sein soll.
            DocumentRenderer docR = new DocumentRenderer(document);
            docR.PrepareDocument();
            if (docR.FormattedDocument.PageCount > 0)
            {
                int pageCount = docR.FormattedDocument.PageCount;

                for (int i = 1; i < pageCount + 1; i++)
                {

                    ErstelleSeitenzahlen(document);
                   
                }
            }


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 24, 2013 10:24 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3097
Location: Cologne, Germany
Typically you add page numbers to header or footer and let Migradoc do the work (there's a field you add to header/footer).

See AddPageField in this sample:
http://www.pdfsharp.net/wiki/HelloMigraDoc-sample.ashx

There are other fields that can be used in header/footer, too.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 24, 2013 11:20 am 
Offline

Joined: Wed Jan 23, 2013 12:25 pm
Posts: 6
Thomas,

you saved me a lot of time.

Many thanks to you and have a nice day.

Oliver


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 85 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