PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri May 03, 2024 8:06 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Working with KeepWith
PostPosted: Thu Jul 29, 2010 8:09 pm 
Offline

Joined: Thu Jul 29, 2010 7:53 pm
Posts: 6
Hi Guys,

I’ve been using MigraDoc to create PDF’s for just over a week now. It’s a great product and I think I’m pretty much up to speed now but I just can quite figure out how to solve one particular problem.
We have a section of our document which lists all the guarantors on the agreement, after all guarantors are listed we have a Witness box.
I want to keep the witness box with the guarantors but there is the possibility that we might have more guarantors than can fit on one page. Also if I have some room left from the previous blocks and the guarantor and witness box will fit within that space then I want to put it there. I.e. There is no page break before the guarantors.

The examples below might explain it more clearly. I can get E.g. 1 and E.g. 2 below to work by putting a keep with on the Rows i.e. row[0].keepwith = table.rows.count-1. However when it comes to case 3 it truncates the table.

What’s the best way to resolve this?

Do I need to figure out the max number I can fit on a page and only apply the keep with up to that number of rows?

By way of example.
E.g. 1 keep all on same page
Some other section
Some other Section
Gtr 1
Gtr 2
Witness

E.g. 2 Automatically break before Gtr1
Some other section
Some other section
Some other section
Some other section
Some other section
<<Migradoc to auto break here>>
Gtr1
Gtr2
Gtr3
Witness

E.g. 3 – More guarantors than can fit on a page.
Gtr1
Gtr2
Gtr3
Gtr4
<<migradoc to auto break>>
Gtr5
Gtr6
Gtr7
Witness


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 29, 2010 8:52 pm 
Offline

Joined: Thu Jul 29, 2010 7:53 pm
Posts: 6
Hi Guys,

I have changed the code so that I only do the keep with for the first 4 entries. I.e. I know I can fit 4 items on a page, so when I hit the fourth item I set the KeepWith on the first row to be with the fourth row. I.e. row[0].KeepWith = 3;
However this doesn't work, it still tries to put all items in the table on a single page, and therefore truncates anything which doesn't fit.


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 08, 2010 8:45 am 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 340
If you send us a MDDDL file, I'll have a look after our holidays.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


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

All times are UTC


Who is online

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