Forum Moderators: phranque

Message Too Old, No Replies

printing a web page well

         

esllou

9:36 am on May 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a problem on a site where a lot of the content naturally gets printed a lot....materials for teachers.

I often get complaints that the pages print out a bit oddly....off to the right normally. The problems are caused by all the ads/menues on the pages in question. Whenever I want to guarantee a good print off my own site, I just highlight the "content" with the mouse and print that....comes out like a "print version" of the page with the ads and other formatting. I can't really expect my users to do that.

Without wanting to go through 1500 pages making a separate "printable version" of each, my question is two-fold:

1. Is there any script that would allow me to make printable versions on the fly adding a user defined variable at the end of every URL eg. widget-p.shtml, widget2-p.shtml, widget-red-p.shtml

2. I seem to remember in the foggy darkness of 2000 when I was learning html something about commands you could put on a page for any printing to start and finish only between those points. Anyone help me on that one?

[edited by: esllou at 9:52 am (utc) on May 2, 2004]

NeedScripts

9:48 am on May 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check out PhPring at [mikenew.net...] I am using it on our website and will have to say it does wonderful job. In addition, it also gives you the option of formatting your page with CSS and to show images too.

Hope this helps.

NS

esllou

10:12 am on May 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



woah! just tried it out....great stuff.

how much customisation can you do...can you put your own logo into the resulting printable version...menu?

great help, thanks

henry0

11:34 am on May 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the Print friendly URL
leads to a 404?

any input

thanks

esllou

12:18 pm on May 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[mikenew.net...]

there was a trailing comma in other link...i had same problem

I have contacted the author about customization...I will have this baby up and running by mid-week on the whole site. Saves me lot of sleepless nights worrying about margins, pixels, table widths, logos, ads, menus, etc, etc

henry0

12:56 pm on May 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you
quite interesting

NeedScripts

1:32 pm on May 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the Print friendly URL
leads to a 404?

Sorry I think I added comma to the URL :(

Hey esllou thanks for correcting it :)

how much customization can you do...can you put your own logo into the resulting printable version...menu?

Sure why not.. I mean, I am using regular table tags within the script and it seems to be working fine. I would recommend you to just play with it.

Also, remember, you can have separate CSS file for the printely friendly version if you wish to do so. So adding menu with its own formatting for printer friendly page should not be hard to do.

P.S.. Nice idea.. I might add the logo(or maybe just header fonts) on the printer friendly page too.. also, it might be wise, to make it black & white.

photon

11:19 pm on May 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're using CSS you can define a print style sheet. See [webmasterworld.com...]

TheDoctor

12:39 pm on May 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think it's a question of "if"; you should use CSS to create print-friendly pages. All this talk of php, which means changing the HTML, is just over-complicated.

I've just finished implementing printer-friendly pages on a messsage board, output from server-side software. I had no control over the HTML, but it was so easy to format the printed pages - three hours work at most.

NeedScripts

1:49 pm on May 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



three hours work at most.

Wow.. 3 hours..

;) using PhPrint it took me about 3 minutes to set it up :)

Also, generally there is no need to change the PHP or anything, it is just the matter of adding 2 lines in your html page and 1 line in your php file (that is if you want css formatting) and you are done :)

esllou

8:23 pm on May 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yeah, I got phprint.php up and going in ten minutes. Just have to add two lines of code into all the pages I want the option for.

I am very much a css1 kind of guy and will leave the more complex css2 until I really need it.

only thing that worried me was the penalties for duplicate content, so I have banned all bots from phprint.php which should save me on that one.

TheDoctor

3:21 pm on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



using PhPrint it took me about 3 minutes to set it up

I never believe estmates that short. Nothing is possible in three minutes. Think about it. How many iterations of design, code, test can you fit into three minutes? If you only thought about a software problem for three minutes you'd only get the right answer by pure chance, never mind about trying to implement the solution.

In any case, I was quoting the time it took when working with HTML that I couldn't change. This involved viewing and analysisng the HTML produced by the server-side software and working out how to format the print from that. I'd like to see that done in less than three minutes.

And if you couldn't change the HTML, you wouldn't be able to add any PHP code - ever!

To make my point again. It's easy to produce printer-friendly pages with CSS, and you can do it with CSS when you can't do it any other way, in a remarkably short time.

NeedScripts

3:34 pm on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I never believe estmates that short.

Hum.. :)

Well.. this is the process.
In the HTML of the page just place <!-- startprint --> & <!-- stopprint --> and within the php file, just insert $baseURL="http://www.yoursite.com"; and you are done.

I know for most people this might take less then 3 minutes.. but I think it took me whole 3 minutes. :)

Trust me, PhPrint is really easy and it works too.

TheDoctor

3:54 pm on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was talking about the total amount of time to do the job, not the amount of time to do some trivial typing.

It's not, incidentally, clear to me how your script would actually control the layout of the printed page. I'm no PHP expert but it looks to me as though it would just print the part of the page between <!-- startprint --> & <!-- stopprint -->, precisely as it appears on the screen. Hardly fits the description of "printer friendly".

I admit, with a bit more work, you could produce a printer friendly page wth PHP. But that would involve a bit more work: designing the layout, checking that what you get is what you originally wanted, amending the code to improve the look of the print etc. And that, my friend, would take time.

NeedScripts

4:55 pm on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would recommend you to test out PHPrint, I am sure you will agree it works good and does not take time to setup.

Also, if you want to see it working, you can check the site in my profile, go to the detailed/listing page and there you will find "print this page" link.

:)

TheDoctor

6:47 pm on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I couldn't find what you're indicating, but I did ntice, when I tried print preview on your home page that the right-hand side of the page was truncated. Not good, IMHO.

I'm sure PhPrint is easy to use. However, software is not a substitute for thinking.

Issues to be resolved include:

  • Which items are not to be printed (eg page and site navigation) - this one is easy.
  • More difficult: fonts. Users find sans-serif fonts easier to read on a screen, serif fonts on paper
  • Colours: do you print in black and white on paper, or leave the colours as on the screen?
  • Relative sizes of headings: these often need to be different on paper than on the screen
  • etc etc

Then, after you've implemented whatever you have to look at the result and check to make sure it looks okay. If it doesn't, repeat stage one (ie thinking).

None of this can be accomplished by code, of whatever nature.

Incidentally, I went to your site and couldn't find the link. But what's wrong with a visitor using the print facility in their browser? A print link involves messages back and forth to the server; printing via the browser is done locally.

NeedScripts

6:52 pm on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<snip>

I have to agree with you. However I assume original poster was looking for a solution that would be something similer to what I have been using. Hence the recommendatin of PHPrint. In addition, I am not making any claims that PHPrint is the best option for everyone, even though it is for me.

I totally agree with you in all your point. However for individuals like me who do not really know much about modifying php, a script like PHPrint can actually be a real blessing :)

[edited by: Brett_Tabke at 7:36 pm (utc) on May 4, 2004]
[edit reason] no self/promotional urls please [/edit]