Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

Header that covers only part of the width of the page Options
Phil
Posted: Wednesday, November 8, 2017 7:00:48 AM
Rank: Newbie
Groups: Member

Joined: 11/8/2017
Posts: 4
I have a requirement to have a header at the top of each page that only covers the right half of the top line. The problem I have is that there is other text on the left (aligned at the top) that is being repeated (as part of the header) on all of the pages. My HTML code looks like the below

Code: HTML/ASPX
<table>
	<td style="vertical-align:top">
		My other data that should not appear in the header but appears within the top line
	</td>
	<td style="vertical-align:top;">
		<table>
			<thead style="display: table-header-group;page-break-inside:avoid;">
			<tr>
				<th colspan="2" style="text-align: left !important;">xxxx MyHeader-Line1 xxxx</th>
			</tr>
			</thead>
			<tr><td>MyData-Line1</td></tr>
			<tr><td>MyData-Line2</td></tr>
			<tr><td>MyData-Line3</td></tr>
			<tr><td>...many more lines...</td></tr>
		</table>
	</td>
<table>


Is there any way I can limit the header to be only part that that is within the "table-header-group" ?
eo_support
Posted: Wednesday, November 8, 2017 9:12:18 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,749
Hi,

You will need to do this in your HTML. The whole header will always be repeated. You will need to adjust your header HTML so that it is empty on the left side and only has visible contents on your right side. As soon as you get your HTML to render the desired result, the PDF will have the desired result. There is no tweaking between these two regarding layout.

Thanks!
Phil
Posted: Wednesday, November 8, 2017 10:37:52 AM
Rank: Newbie
Groups: Member

Joined: 11/8/2017
Posts: 4
Many thanks for the reply - just to confirm


The PDF generated by the above HTML posted is as follows (below the period character is used to simply align MyData-Line999 in the editor):-


My other data that should not appear in the header but appears within the top line xxxx MyHeader-Line1 xxxx
....................................................................................................................MyData-Line1
....................................................................................................................MyData-Line2
....................................................................................................................MyData-Line3
....................................................................................................................MyData-Line4
....................................................................................................................MyData-Line5
....................................................................................................................MyData-Line6
....................................................................................................................MyData-Line7
....................................................................................................................etc
========================================================================page-break
My other data that should not appear in the header but appears within the top line xxxx MyHeader-Line1 xxxx
....................................................................................................................MyData-Line100
....................................................................................................................MyData-Line101
....................................................................................................................MyData-Line102
....................................................................................................................MyData-Line103
....................................................................................................................MyData-Line104



What I want is as follows (below the period character is used to simply align MyData-Line999 in the editor):-


My other data that should not appear in the header but appears within the top line xxxx MyHeader-Line1 xxxx
....................................................................................................................MyData-Line1
....................................................................................................................MyData-Line2
....................................................................................................................MyData-Line3
....................................................................................................................MyData-Line4
....................................................................................................................MyData-Line5
....................................................................................................................MyData-Line6
....................................................................................................................MyData-Line7
....................................................................................................................etc
========================================================================page-break
....................................................................................................................xxxx MyHeader-Line1 xxxx
....................................................................................................................MyData-Line100
....................................................................................................................MyData-Line101
....................................................................................................................MyData-Line102
....................................................................................................................MyData-Line103
....................................................................................................................MyData-Line104


Are you saying this is not possible ? i.e. is there is no way to put text within that header line without it showing up in subsequent headers ?
eo_support
Posted: Wednesday, November 8, 2017 10:45:07 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,749
Hi,

No. That is not possible with the built-in header repeating feature. The built in header repeating feature always repeat the whole header on every page. There are no options for you to customize per page.

If you want to have different headers per page, you should do some kind of "post process": run the main contents first, then use a loop to loop through each page and render additional output on every page however way you want. You can even render a solid white area in the header area from the second page on to cover up the area of the header section that you want to be invisible.

Thanks

Phil
Posted: Wednesday, November 8, 2017 10:55:57 AM
Rank: Newbie
Groups: Member

Joined: 11/8/2017
Posts: 4
Again thanks for the reply - this could be a problem for us - again to confirm:-

When you say "The built in header repeating feature always repeat the whole header on every page. There are no options for you to customize per page." - we're not actually changing the header - it is static - i.e. we only want to put the part that is in the "table-header-group" which is "xxxx MyHeader-Line1 xxxx" - this doesn't change - ever - the other text is printing in the header only because it happens to be in that top area where the header happens to appear
eo_support
Posted: Wednesday, November 8, 2017 11:07:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,749
I see what you meant. The key missing piece of information that wasn't pointed out here is when the converter repeats a table header, it doesn't exactly repeat the header itself. It repeats the whole section from the top of the header to the bottom of the header. So for example, if the Y value of your table header spans from 10 px to 50 px, then everything between Y = 10px to Y = 50px is repeated. This is why your "other data" got repeated because it falls into that Y range.

The easiest way for you to fix this kind of situation is to NOT to render the "other data" with the main contents and then add it after you convert the main contents through "post process" as mentioned in the previous reply.
Phil
Posted: Wednesday, November 8, 2017 11:32:33 AM
Rank: Newbie
Groups: Member

Joined: 11/8/2017
Posts: 4
OK thanks - unfortunately post processing isn't really feasible - we have lots of reports - and the part that comes out in the header that shouldn't, isn't always simply text (sometimes a chart) and it sometimes overlaps with the body. We are trying to migrate over from another PDF tool which does support this requirement however speed is the reason for migrating (I suspect post processing would slow it down especially for a large report)

Is there any way the tool could be enhanced to include the functionality driven purely by HTML ?
eo_support
Posted: Wednesday, November 8, 2017 1:03:39 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,749
Unfurtunately no. I do not believe this will be supported in the near future. In your case, you will need to either give up the repeating headers all together, or use post process to add the additional output on the first page. If you just add simple additional output on a single page, you can use our ACM interface to do so and it will be very fast. The performance impact will be minimum.



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.