PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 4:33 pm

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
PostPosted: Sun Mar 10, 2024 1:10 pm 
Offline

Joined: Thu Feb 22, 2024 1:31 pm
Posts: 10
I'm trying to create a table (3 or 4 rows) which will be added after another table but if this new table doesn't entirely fit in the remaining spaces in that page then it should move to the next page.
I've tried using
Code:
myTab2.Format.KeepTogether = true;
but that doesn't work.


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 10, 2024 1:44 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 916
Location: CCAA
Set "KeepWith" for the first row of the table. If the table has four rows, set KeepWith to 3.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 10, 2024 3:48 pm 
Offline

Joined: Thu Feb 22, 2024 1:31 pm
Posts: 10
THANKS @TH-Soft. I did
Code:
myTab.Rows[0].KeepWith = myTab.Rows.Count - 1;
doc.LastSection.Add(myTab);


So far, seems to do the job :D But needs further testing


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: Google [Bot] and 375 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