Paragraph- Keep with next ... workaround

I need the Paragraph- Keep with next feature in the documents I’m creating.

Since this is not currently supported in Words, can you see any possible problems with the following workaround?

Enclose the paragraphs to be kept together in a single cell table [with no borders] and set row property ‘allow row to break across pages’ to false.

Some of the paragraphs contain a table, so I’d have a nested table. Would that cause a problem? The tables do not use regions but do contain mergefields.

The processed .doc will be sent to aspose.pdf

Thanks.

-Charu Tevari

ps: since my output documents will not be opened with msWord, I find the spreadsheet at https://docs.aspose.com/words/net/supported-document-formats/ extremely useful. You might want to consider giving it more publicity.

I’m confused. Words doesn’t support “Keep with next”??? Unless I’m mistaken it does. Use this code:

docBuilder.ParagraphFormat.KeepWithNext = true;

You may have to play with it to see when the appropriate time to set it is. I think you may have to write of the text and them set it.

John

Charu,

One problem I can see possibly happening with nested tables is when you have rows marked as “header” rows so they repeat at the top of each page if the table overlaps pages, they might not behave correctly.

John.

John,

If the processed document is opened in MSword it will follow the ‘keep with next’ directive. But if the document is sent to Aspose.pdf, the ‘keep with next’ is ignored [see https://docs.aspose.com/words/net/supported-document-formats/.

My application needs to generate and display documents where the end user has no awareness that the documents are designed in MSword, and I have no guarantee that the end user will have MSword installed on their machine. So I need to convert to pdf to display a print preview of the document.

Now, some day in the future, Aspose.words viewer will be available with a print preview mode…[hint, hint!] and I will not have this problem.

Charu,

My apologies. I didn’t fully understand the situation. While I don’t use Aspose.PDF it is good info to know.

Thanks,
John

Nested table by itself won’t cause any problem. It is the nested MailMerge with regions that is not yet supported.

The issues you have found earlier (filed as 39) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)