We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

keptWithNext feature is causing content to disappear


Are there any known issues in setKetWithNext() api. I am generating pdf using dynamic content. When I use KeptWithNext(true) on a textfragment, sometimes that content is not displayed in the pdf.

I am doing similar to this:

TextFragment tf = new TextFragment(“Testing”);


//adding this fragment to page

HtmlFragment hf = new HtmlFragment("

Following paragragh
//adding this fragment to page

Here I am trying to keep title and atleast part of paragraph together.



Hi Mamatha,

Thanks for contacting support.

Can you please share complete code snippet and sample output being generated at your end, so that we can test the scenario in our environment. We are sorry for this inconvenience.


I was able to compile a simple program to reproduce the problem. I have included the files.

I am using pdf 11.8 version. Same is the case with licensed version.



Hi Mamatha,

Thanks for sharing the sample code. I have tested the scenario and noticed that reported issue, so logged a ticket PDFJAVA-36186 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

We are sorry for the inconvenience.

Best Regards,

The issues you have found earlier (filed as PDFJAVA-36186) have been fixed in Aspose.Pdf for Java 16.11.0.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.