Page 1 of 1

print friendly pages

Posted: Fri Oct 18, 2002 5:21 am
by noguru
Hi

I need to design a template page which will lie in a specific directory on the server. All developers in our section will then just send their page to this template as a parameter in an <a> tag, such as this:

Code: Select all

<a href="http://path on server/print_template.php?page=http://path to your page/yourpage.php" target="_blank">
The template page must then convert the page into a print friendly page that will fit nicely on the screen and if printed does not overflow. I want this template to be used by anyone as a simpler quicker means to display a print friendly page, without them having to copy and change all their existing pages which they want to be printable. This way they will need only one line of code on their page instead of having to design a whole new copy of that page.

Thanks

re: print friendly pages

Posted: Fri Oct 18, 2002 7:55 am
by swush
hi,

i might get you wrong but i think you're choosing the wrong way. instead of sending the whole html-page to the template-script, you should transform the content to the normal page or to the printer-friendly one. This of course means you'd have to apply a template to all pages. But thats the only way i know to solve such problems effectivly.

Posted: Fri Oct 18, 2002 11:54 am
by noguru
What I actually meant was even if the page is too wide to fit onto an A4 page when printed, the browser must somehow know to automatically fit the page onto an A4 page, even if it means that the browser must reduce the size of the contents of the page in order to fit. The reason is our clients might want to print some of the pages, but then the page gets cut off at the right-hand side. It is impossible to redesign all of our pages at this stage, so I thought it would be the easiest way to just send the whole page to somewhere where it can somehow be forced to be printed as A4. But I don't really know how I should do it.

Posted: Fri Oct 18, 2002 11:57 am
by Crashin
I'm not sure how the pages to be printed are being built, but I had a similar issue with knowledgebase entries that needed to be printable. I built the knowledgebase pages using data from a database, and just built a printable version using the same data. But, if you're talking about various, pre-formatted pages you could try loading the page in a new window that's sized to your specifications without any menus, images, or other junk that would foul up the printing.

Posted: Fri Oct 18, 2002 12:01 pm
by noguru
I already tried that and it was still cutting off some of the text on the right-hand side.