PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Tue Nov 04, 2025 7:51 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Fri Sep 06, 2013 4:18 am 
Offline

Joined: Fri Sep 06, 2013 4:05 am
Posts: 5
Hi, I am generating table which lengths multiple pages. I have groups of 3 rows each. There must not get a page break between the rows in a group. So I tried to set the 1st rows KeepWith=2. For the next two rows I am not setting this property.

But this is not working.. Any idea how to keep rows together without a page break in between them.


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 06, 2013 7:16 am 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 355
Hi!

Set KeepWith at the correct Row to make it work.

See also:
http://stackoverflow.com/a/18643633/1015447

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


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 07, 2013 1:19 pm 
Offline

Joined: Fri Sep 06, 2013 4:05 am
Posts: 5
Hello, Thanks for your help. But it is not working...!!!
I am not using the official assemblies of migradoc but instead I am using this
http://www.pakeha_by.my-webs.org/MigraD ... ender.html

So maybe for this reason it is not working. I am having huge number of rows in the table so it does take almost 20 mins to generate a pdf in official library where as this patched version takes only around 2-3 mins. So I cannot change to the official library.

Is there any other way to Keep the 3 rows group together? Like to predict the page end and make a manual page break or any alternative.. I am also using headers so on every page heading this logo and address header is printed.


Top
 Profile  
Reply with quote  
PostPosted: Sun Sep 08, 2013 7:22 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 355
Try the "official" library to see if the fault is in your code or in the optimized library.

Pakeha has fixed some faults of his patch - maybe he'll also fix this one (if it is a fault of his library patch).

If it doesn't work with the "official" library, then search the error in your code - maybe show your code here so we can help.

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


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 09, 2013 9:18 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3136
Location: Cologne, Germany
moizpalitanawala wrote:
Hello, Thanks for your help. But it is not working...!!!
I am not using the official assemblies of migradoc but instead I am using this
http://www.pakeha_by.my-webs.org/MigraD ... ender.html
It's a known limitation of this patch that KeepWith is not working.
See also:
viewtopic.php?p=6940#p6940

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 09, 2013 9:22 am 
Offline

Joined: Fri Sep 06, 2013 4:05 am
Posts: 5
Is there any other way to do this job? Some other workaround.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 09, 2013 9:29 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3136
Location: Cologne, Germany
pakeha_by offered to investigate this problem (see the other thread).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 09, 2013 9:34 am 
Offline

Joined: Fri Sep 06, 2013 4:05 am
Posts: 5
That post is of 2011. I am using his most recent library so it seems that he has not corrected it.
It would be helpful if you can guide me. If I know that page will break in the next 3 rows than my problem will be solved. I will just add empty rows there.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 09, 2013 12:41 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3136
Location: Cologne, Germany
Quote:
If I know that page will break in the next 3 rows than my problem will be solved.
With MigraDoc you define documents consisting of sections and paragraphs. There are no pages at this stage.

When the document gets rendered to PDF, then pages will be created and pagebreaks will be added.
When you render to RTF, no pagebreaks will be added.

When adding paragraphs, there are no pages and no-one can tell you whether the page is nearly full.

MigraDoc allows you to modify any paragraph at any time. A line may be near the bottom - until you alter the page margins.

Long story short: while adding lines to a table, there are no pages and you cannot find out whether you are near the bottom of a page.

Measure the text you add to tables or otherwise estimate how many rows will fit one page - and start a new table after a pagebreak.

Did you try to contact pakeha_by? His last post is from April 2013 when he offered to look after the KeepWith problem.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 14, 2013 5:33 am 
Offline

Joined: Fri Sep 06, 2013 4:05 am
Posts: 5
My problem got solved..!! I emailed pakeha and he sent me the fix. The updated assemblies has the issue of KeepWith Property solved..!!
Thanks a lot:-)


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 14, 2013 6:22 am 
Offline

Joined: Wed Jan 19, 2011 5:34 am
Posts: 19
In case somebody needs KeepWith property to work I've updated patched assemblies: http://www.pakeha_by.my-webs.org/MigraDocFastTableRender.html


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

All times are UTC


Who is online

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