printing a page

This is a discussion on printing a page within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I haven't figured where to post this. I'm working in PHP so I thought I would try here. ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-07-2004
Greg Brewer
 
Posts: n/a
Default printing a page

I haven't figured where to post this. I'm working in PHP so I thought I
would
try here.

I have four pieces of information I want to display -- each is variable
number of lines. For viewing, I want it to be a long, narrow display so
that you only need to scroll down to see everything. So it will be a table
with 4 rows.

When printing though, I want it to be shorter so that everything will
usually fit on one page. For that, I need rows 2 and 3 to be side by side.

The equavalent of what I want is
viewing
<table><tr><td>stuff1</td></tr><tr><td>stuff2</td></tr><tr><td>stuff3</td></
tr><tr><td>stuff4</td></tr></table>

printing
<table><tr><td>stuff1</td></tr><tr><td>stuff2></td><td>stuff3</td></tr><tr><
td>stuff4</td></tr></table>


I've used media type on CSS to make printed output look different from
displayed output but for the life of me, I cannot figure out how I can get
php to render this page so that it will print side by side when printing.

Anyone have any ideas?

Thanks,
Greg




Reply With Quote
  #2 (permalink)  
Old 06-07-2004
Rob
 
Posts: n/a
Default Re: printing a page


"Greg Brewer" <Greg@Brewer.net> schreef in bericht
news:40c3ab6e$0$444$a726171b@news.hal-pc.org...
> I haven't figured where to post this. I'm working in PHP so I thought I
> would
> try here.
>
> I have four pieces of information I want to display -- each is variable
> number of lines. For viewing, I want it to be a long, narrow display so
> that you only need to scroll down to see everything. So it will be a

table
> with 4 rows.
>
> When printing though, I want it to be shorter so that everything will
> usually fit on one page. For that, I need rows 2 and 3 to be side by

side.
>
> The equavalent of what I want is
> viewing
>

<table><tr><td>stuff1</td></tr><tr><td>stuff2</td></tr><tr><td>stuff3</td></
> tr><tr><td>stuff4</td></tr></table>
>
> printing
>

<table><tr><td>stuff1</td></tr><tr><td>stuff2></td><td>stuff3</td></tr><tr><
> td>stuff4</td></tr></table>
>
>
> I've used media type on CSS to make printed output look different from
> displayed output but for the life of me, I cannot figure out how I can get
> php to render this page so that it will print side by side when printing.
>
> Anyone have any ideas?
>
> Thanks,
> Greg
>
>
>


Greg,

When the user presses the print button ( or when the javascript function
window.print() is called) the page gets printed. All of this is on the
client machine and the current (the 'viewing') HTML will be printed. My
guess is to make an extra step and create a second page with the 'printing'
HTML.

Add a 'print' button on the viewing HTML and when clicked show the printing
page and let the user print the page through the browser.

or

add a hidden iframe and set the src attribute to the printing page. When the
user hits your printing button on the viewing HTML call
document.iframe_id.print(); in javascript and the printing page will be
printed.

As you see the actual printing is done in javascript so for further help on
this subject you should go to a javascript newsgroup.

HTH rob


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:35 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0