Has anyone run into this? If so is there a solution?
Thanks for any help!
Has anyone run into this? If so is there a solution?
Thanks for any help!
I am working on a complex application that generates HTML documents that I am evaluating Aspose Words.NET to convert the HTML documents to PDF/Word format. It does a great job, however, when I have HTML page breaks in table cells of the HTML documents I get the exception “cannot insert the requested break inside a table.” The page breaks are simple HTML tags below.
Hi John,
Thanks for your inquiry. It would be great if you please share following detail for investigation purposes.
create a standalone/runnable simple application (for example a Console
Application Project) that demonstrates the code (Aspose.Words code) you used to generate
your output document
Sure it is very easy to reproduce. I included a .NET 4.5 project with a simple sample HTML document in it. It seems to be unhappy with having a page break in a table cell.
Hi John,
Thanks for sharing the detail. I have tested the scenario and have managed
to reproduce the same issue at my side. For the sake of correction, I
have logged this problem in our issue tracking system as WORDSNET-12158.
I have linked this forum thread to the same issue and you will be
notified via this forum thread once this issue is resolved.
We apologize for your inconvenience.
Thanks for the quick responses! Any idea as to timeline for fixes of this nature? We are looking at going into production and buying the component within a couple months.
Hi John,
Thanks
for your inquiry. I would like to share with you that issues are
addressed and resolved based on first come first serve basis. Currently,
this feature is pending for analysis and is in the queue. We will update
you via this forum thread once there is any update available on this feature.
Thank you for your patience and understanding.
The issues you have found earlier (filed as WORDSNET-12158) have been fixed in this .NET update and this Java update.
Sorry for the late reply on this thread, I have been away.
Thanks again for taking the time to help me solve this issue! Paging is very important to our product and customers.
I pulled down the version referenced in this thread and tested it. So the problem of getting an exception on a page break in the table cell now is solved however, now it looks like no page breaks are working at all in this version. Inside or outside of a table cell.
I have tried both tags:
and neither work.
I have attached a sample project that demonstrates the problem and references the new version listed in the thread.
Please let me know if there is anything further that you need from me or if I can help in any way.
We are looking to buy an enterprise license by the end of this month to use with our new Cloud solution, however, first my manager wants to make sure we can support pagination since it is so important to our product.
Thanks again for all your help!!
John Lewis
jlewis@comprose.com
COMPROSE, Inc.
425-281-4910
OK slight update to this. I downloaded the latest version of ASPOSE Words .NET from Nuget and I am able to get a page break to work so long as it is not in any other tag by using the BR tag below. As soon as the page break is surrounded by a table cell or another tag like P or DIV then it no longer works.
Hi John,
Thanks for your inquiry. You can use page break style in P and BR tags as shown below.
<p style=“page-break-before: always”><o:p></o:p>
PAGE BREAK
</p>
<br style="page-break-before: always; clear: both" />
Thanks for the information, we have tried this with success so long as the break is not in a table. How do we get the breaks to work in a table cell?
This is text and then BREAK <br style=“page-break-before: always; clear: both” /> Now text on next page. |
This is text and then BREAK <br style=“page-break-before: always; clear: both” /> Now text on next page. |
This is text and then BREAK <p style=“page-break-before: always”> PAGE BREAK<o:p></o:p> </p>Now text on next page. |
Hi John,
Thanks for your inquiry.
Document doc = new Document(MyDir + “in.html”);<o:p></o:p>
foreach (Table table in doc.GetChildNodes(NodeType.Table, true))
{
foreach (Paragraph para in table.GetChildNodes(NodeType.Paragraph, true))
{
if (para.ParagraphFormat.PageBreakBefore)
{
((Row)para.GetAncestor(NodeType.Row)).FirstCell.FirstParagraph.ParagraphFormat.PageBreakBefore = true;
}
}
}
//Save output document
doc.Save(MyDir + "Out.docx");
Thanks for the quick response!
FIRST PAGE
PAGE BREAK
SECOND PAGE
|
|
node but that didn’t work at all either.
Hi John,
Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. If you load the same Html in MS Word, there will no page break. If you insert page break inside table’s row, the table will be split into two tables.
FIRST PAGE PAGE BREAK SECOND PAGE
|
First Second Third |
Second row Second Third |
Second row Second Third |
Thanks for the response!
Hi John,
Thanks for your inquiry. Please use PageSetup.Gutter Property to get or set the amount of extra space added to the margin for document binding.