Avoid table split in PDF output

Participant ,
Feb 23, 2020

Copy link to clipboard

Copied

Hi 

I am using RH 2017. I am generating a PDF output from RH 2017 directly, i.e I am not generating a Word doc first and then converting to a PDF. In this scenario, I have noticed that the table splits in the PDF output. Please could you let me know what needs to be done to achieve the following:

  • I do not want the table to split - I would like the complete table to start from the next page rather than continuing to the next page.
  • Is it possible to have the table header repeated?
TOPICS
Classic

Views

298

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Feb 23, 2020

Copy link to clipboard

Copied

I don't believe that can be done using the PDF output. If you generate to Word, then you can insert page breaks and set the first row to repeat. If there are many tables you could possibly create Word macro to do that.

 

There is a Word macro on my site that will find the next table. That would be a start to speeding up the process.

 

Please use the blue Reply button at the top to help me help you. The black Reply link nests replies and they sort out of order.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Contributor ,
Feb 24, 2020

Copy link to clipboard

Copied

I'm using 2019, but maybe 2017 works the same in this regard.

 

Repeating the table header you can do as follows:

<table>
<thead>

<tr>
<td>Repeating text col 1</td>
<td>Repeating text col 2</td>
</tr>
</thead>
<tbody>
Rest of the table

</tbody>

</table>

 

Preventing page breaks isn't very well implemented in RH PDF output, at least not in version 2019 new. Normally you should be able to add page-break-before/after/inside: avoid; to an element (such as the <table> element, or a <tr> element), but I've found that RH ignores most of these in many cases. The inside version is supported the most, but still very sparingly. Try to add them to different elements to see if it helps, for example, <table style="page-break-inside: avoid;"> (or add it to the CSS), however in 2019 new that one has no effect. I think in lists it does have effect but can't tell from the top of my head.

 

One thing that also doesn't work is avoiding page breaks after headers, which makes the pdf output almost unusable IMO, at least when you've got longer topics with H2 and H3.

 

Good luck! Hope this helps.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Feb 24, 2020

Copy link to clipboard

Copied

Erwin - Remind me please. Are you using 2019 Classic or New UI?

 

I haven't tested but I thought Classic didn't support table headings but even if it did work with behind the scenes HTML, have you tested that it carries through to the PDF output. I'm not doubting you, just asking.

 

Please use the blue Reply button at the top to help me help you. The black Reply link nests replies and they sort out of order.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Contributor ,
Feb 24, 2020

Copy link to clipboard

Copied

In 2019 new UI it carries through to the pdf, just tested it to be sure. Making everything <tbody> doesn't repeat the top line (just tested that too 🙂 .

 

In fact, I think the output of the PDF in the new UI looks really good, apart from the dealbreaker of not being able to control pagination inside long tables and after headings.

 

I'd hate to be forced to go through Word just for that, because in the PDF, all lists look exactly the same as they do in HTML, while in Word it needs a lot of extra formatting. In that respect, the new UI works worse for Word than the old UI, because pure HTML lists are a lot harder to translate to Word than the pseudo-multi-level-lists that the old UI used (at least during my previous experience with RH9, I have not used RH after that, so not sure if they changed the list structure after then). These pseudo-lists were much more like (inspired by?) the Word multi-level lists.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Participant ,
Mar 01, 2020

Copy link to clipboard

Copied

Thank you Peter and Erwin.

 

Erwin - Let me give it a try and check how well it goes. Will post an update here.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Participant ,
Mar 04, 2020

Copy link to clipboard

Copied

Hi Peter and Erwin

The above suggestion by Erwin to repeat the header works. But, unfotunately it works only once. For example, I have a table with x rows and y clolumns and I add the <thead> tag. The PDF output repeats the header.

Now, if go back to the topic in RH, make a few changes to the table and then on generating the output, the table header does not repeat itself. I looked into HTML and for some reason RH removed the <thead> tag. 

 

Is there a way to keep the <thead> tag? If I have 20 tables, I will end adding the tag everytime I go back to RH for a modification.  

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Mar 04, 2020

Copy link to clipboard

Copied

What Erwin has offered is something that he has tested works in 2019 New UI. I know that you want to generate to PDF directly and I know that Erwin prefers that route. All I can do is repeat that what I have seen over the years on the forum is people reporting issues in Classic with what you want to achieve.

 

I don't have an answer other than it's why I generate to Word first as it gives you so much more control over getting the document as you want it in Classic. I think there is a macro on my site that either does what you want in Word or would just need a bit of tweaking.

 

Please use the blue Reply button at the top to help me help you. The black Reply link nests replies and they sort out of order.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Contributor ,
Mar 04, 2020

Copy link to clipboard

Copied

I would love to go through Word. It should give more control. I did it rather successfully back in the day using RH9. However, in RH2019 new UI, it is just unusable at the moment. See the attached screenshots, one for the PDF output, one for the Word output.

 

Note: I have mapped all styles correctly into the Word template styles.

 

In the PDF output, see the consistent font size? See the consistent indenting? All the bold text comes from a character style. Wonderful.

 

In the Word output, see the different font sizes? See the weird indents? And except the heading and the footnote line at the bottom, every single line is style Normal + direct formatting. The bold is also direct formatting, even though the character style has also been mapped correctly.

 

There is no control whatsoever, and I'm not going to edit 200-odd pages like this. I'd rather take my losses and use the limited PDF output with its broken up tables and headers. I wonder if anyone is using the Word output from RH2019 New in a production environment. I'd be very interested to see how they do it, because I wouldn't have a clue how to do this without massive editing in Word afterwards.

 

PDF output, 100% view:

 

PDF output, 100% viewPDF output, 100% view

 

Word output, 100% view:

 

image.png

 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Mar 04, 2020

Copy link to clipboard

Copied

Apologies. I thought your position was you didn't want to go through Word at all rather than because of the way it is working.

 

Could you create and share a one topic project with the topic in your image, using your CSS, and share the template you are using? If you have edited pdf.css, please also send that. I would like to see what, if anything, I can do with that and share it with Adobe if necessary.

 

Please use the blue Reply button at the top to help me help you. The black Reply link nests replies and they sort out of order.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more