PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Can I keep section titles with paragraph?
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2377
Page 1 of 1

Author:  briankitt [ Wed Mar 20, 2013 6:21 pm ]
Post subject:  Can I keep section titles with paragraph?

I am using Migradoc. The user has the option to create PDF or Word (RTF) so I can't use PdfSharp.

I have a report, that is variable content based on available input data. There are various sections with the report, as seen below. The problem is, that since the data is variable, we never know when a page break will be. But sometimes the section header will print, then a page break, then the section. Is there any way to tell Migradoc, not to print the section title if there is only 2 lines left on the page? Alternately, is there a way to tie this section header to the paragraph, so they will always print on the same page? The section text is never more than 2 or 3 lines, and it's generally followed by a variable data table.

Section Title 1

section text
section text
section text

[table data]
[table data]
[table data]

Section Title 2

section text
section text
section text

[table data]
[table data]
[table data]

Section Title 3
___________________________________________________<this is a page break automatically inserted by MigraDoc>
section text
section text
section text

[table data]
[table data]
[table data]

Author:  Thomas Hoevel [ Thu Mar 21, 2013 9:07 am ]
Post subject:  Re: Can I keep section titles with paragraph?

Hi!

Activate KeepWithNext for all titles (this works for paragraphs followed by paragraphs, but not for paragraphs followed by tables - so it should work for your case).

Author:  briankitt [ Thu Mar 21, 2013 4:03 pm ]
Post subject:  Re: Can I keep section titles with paragraph?

PERFECT!!! THANKS!!!

Now I know what option to look for, I see you have answers this several times. So I'm sorry to be a broken record.

Thanks very much.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/