Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing - insert html at bottom of each pg

Status
Not open for further replies.

andycape

Programmer
Aug 22, 2003
177
ZA
I have a little table i want to insert at the bottom of each page when i print.
How do i do that ? (ie : work out when the page is going to cut off so that i can enter it).

This form that i am printing will never be the same size, it has loops in it that read data from a database, so it will change length (and amount of pages), depending on the info from the database.

I am using a {page-break-before: auto} when i want the page to break if that certain table cannot fit onto the page.

thanx.
 
andycape,

A server-side script would be the best choice for you. Create a "Print" button or link on each page. Clicking that link or button would cause the server to generate a PDF from the page. The user could then save or print the PDF.

PDF's are really the only way to reliably control the layout of a page like what you want as
Code:
{page-break-before: auto}
is not supported by all browsers. PHP has built-in PDF creation capabilities. I'm sure other scripting languages have something similar available.

Good luck,
-Ron

We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are. -Me

murof siht edisni kcuts m'I - PLEH
 
I am creating a PDF and its working fine, what I need to find out is how to insert the table at the bottom of each page.
 
How are you creating the PDF? Maybe I'm not correctly understanding what you're trying to do.

In the process of parsing the page to the PDF writer, you can specify where you want the bottom of the page. Just dynamically insert the table before the page break.

-Ron

We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are. -Me

murof siht edisni kcuts m'I - PLEH
 
I'm using the following code to make the PDF (its working fine):

Set myexec = Server.Createobject("Dynu.Exec")

Result = myexec.execute(PathToHTMLDOC & "htmldocd.exe --webpage --size a4 --top 0.2in --left 1.2cm --right 1.2cm --bottom 0.2in -f "&FilePath&" ""
I could include the table just before each page break but I'm not sure when the page breaks are going to occur. To be honest my {page-break-before: auto} is not working properly, only the {page-break-before: always} is working.

Its because I dont know when the page break is going to occur (because the document varies in length) that i'm not sure when to include the table.
If I was only using {page-break-before: always} then i could just copy it in before each break.
I'm using ASP, maybe i should be using PHP as you say but i just dont know PHP ;-)

andy
 
so do you know how what code i can use instead of {page-break-before: auto} when sending the page to the writer ?

so that it will break if a certain object cannot fit onto the page, and then also insert the table that must go at the bottom of each page ?

This is what i'm ultimatly trying to do.
 
andy,

Sorry, but we're getting a little out of my area of expertise. I don't know a bunch about ASP. To be completely honest with you, it might be good for you to repost this (revised) question to the ASP forum (forum333). Or, if you decide to change teams, then repost to the PHP forum (forum434). [wink]

Anyway, good luck!
-Ron

P.S. Maybe someone else monitoring this thread can take the baton from here...

We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are. -Me

murof siht edisni kcuts m'I - PLEH
 
***** baton being passed ******


......anyone ? ;-)
 
I'm a novice at this stuff, but how about dropping the entire content into a table and use the following:
Code:
<STYLE type=&quot;text/css&quot;>
thead {display:table-header-group} 
tfoot {display:table-footer-group} 
</STYLE>
...
<table border=0>
<thead>
<tr><td>
Page Header (when printed) goes here
<HR>
</td></tr>
</thead>

<tbody>
<tr><td>
All the document details go here<BR>
All the document details go here<BR>
All the document details go here<BR>
All the document details go here<BR>
All the document details go here<BR>
All the document details go here<BR>
All the document details go here<BR>
All the document details go here<BR>
</td></tr>
</tbody>

<tfoot>
<tr><td>
<HR>
Page Footer (when printed) goes here
</td></tr>
</tfoot>
</table>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top