Welcome Guest Search | Active Topics | Sign In | Register

Page-break-before causing unusual results Options
Mark Davies
Posted: Thursday, October 26, 2017 1:56:57 AM
Rank: Newbie
Groups: Member

Joined: 6/1/2014
Posts: 3
Hi

We are using HtmlToPdf, and using it with page-break-after: always to make sure each statement starts on a new page.

We have this unusual instance where, seemingly at random, it makes part of the table of the new page appear underneath the content of the previous page, then on the new page displays the other part of the content, but then repeats the entire new page underneath it anyway.

So if we have content like:

content line 1
content line 2
content line 3
content line 4

it will display like:

Old page content
content line 4

<new page>
content line 1
content line 2
content line 3

content line 1
content line 2
content line 3
content line 4

Our HTML is valid, it works correctly in print mode on the browser. We've tried running it on your HTMLToPdf page on the EO website, and it produces the same result as we see in the code.

Am I able to send you the HTML to investigate?

Thanks
Mark
eo_support
Posted: Thursday, October 26, 2017 5:27:02 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi Mark,

Yes. Please send the HTML to us and we will be happy to investigate further:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks!
Mark Davies
Posted: Thursday, October 26, 2017 6:19:49 PM
Rank: Newbie
Groups: Member

Joined: 6/1/2014
Posts: 3
Thanks, email sent to support inbox.
eo_support
Posted: Thursday, October 26, 2017 6:24:27 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Yes. We have it. We will look into it and get back to you as soon as possible.
eo_support
Posted: Monday, October 30, 2017 10:49:00 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

We have looked into the file you sent to us. The root of the problem is this feature:

https://www.essentialobjects.com/doc/pdf/htmltopdf/table_header.aspx

This feature is enabled by default and it is what caused the repeating contents on each page for you. It works reasonably well for simple table with simple header/footers. But it can cause very confusing result for complex header/footer like yours. You can simply turn it off by setting HtmlToPdf.Options.RepeatTableHeaderAndFooter to false.

You may also want to make sure that you are running the latest build first. We tested with the latest build and while it does repeat table header/footer as expected, it does produce results that seems to be different than what you described. We did fix some issues on the table header/footer repeating part this year. So updating to the latest build should help you avoiding that.

Please feel free to let us know if you still have any questions.

Thanks!
Mark Davies
Posted: Monday, October 30, 2017 6:12:57 PM
Rank: Newbie
Groups: Member

Joined: 6/1/2014
Posts: 3
Hi Support

Thanks - we updated the most recent build, and trialled both with Repeating headers on, and repeating headers off. As you describe, repeating headers off removed the incorrectly duplicated content.

The problem is we want the repeating headers to appear. Our clients are very specific in the format of these documents, and we need the formatting to appear so that it lists the heading section showing the person's name, their details then the table or continuation of the table.

That top part includes margins at the top of the page, which are dependent on whether the user wishes to use their own letterhead, or our letterhead. They also need the repeated details of the owner/horse details to show on the second page. Because we can't tell via HTML when the page break will be - we've used the repeating tables to make this happen.

How can we make that work otherwise?

If it works correctly on the Print version via HTML, surely it must be able to work on the PDF version?

Thanks
Mark
eo_support
Posted: Tuesday, October 31, 2017 1:10:39 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

I am not sure if I understand your situation correctly. When you have table header/footer on (by default), it supposes to duplicate the table header/footer for you on each page. That's exactly what the converter did. If you want to control which part of the contents to be duplicated, you would control which part appears inside thead/tfoot element. For example, if you do not have a thead row, then no table header will be duplicated. This should give you full control on which part to be duplicated and which part not to be duplicated.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.