Page 1 of 1

how to control printing of document with php

Posted: Sun Jul 06, 2008 4:31 pm
by shaun112
is there a way of controing document printing with php :banghead: :banghead:


//i appreciate your replies but what i really want is (

select data from my database and after doing this, print out the information
roll by roll to an A4 paper. pleas i am still very much a beginer in php so pleas be very comprensive thanks in advance.

Re: how to control printing of document with php

Posted: Mon Jul 07, 2008 2:31 am
by jaoudestudios
You can easily do it with CSS.

When you link to a CSS style sheet you need to specify a media type, options are...
all - Suitable for all devices
aural - Intended for speech synthesizers. See the section on aural style sheets for details.
braille - Intended for braille tactile feedback devices.
embossed - Intended for paged braille printers.
handheld - Intended for handheld devices (typically small screen, monochrome, limited bandwidth).
print - Intended for paged, opaque material and for documents viewed on screen in print preview mode. Please consult the section on paged media for information about formatting issues that are specific to paged media.
projection - Intended for projected presentations, for example projectors or print to transparencies. Please consult the section on paged media for information about formatting issues that are specific to paged media.
screen - Intended primarily for color computer screens.
tty - Intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities. Authors should not use pixel units with the "tty" media type.
tv - Intended for television-type devices (low resolution, color, limited-scrollability screens, sound available).

So just use the print option and code the CSS to how you want it to print, if at all, as you can do display none on the body and nothing will print.

Re: how to control printing of document with php

Posted: Mon Jul 07, 2008 3:50 am
by onion2k
Most CSS print options won't work on older browsers. If you need proper print control generate a PDF file.

Re: how to control printing of document with php

Posted: Tue Jul 08, 2008 2:01 pm
by Ollie Saunders
Most CSS print options won't work on older browsers. If you need proper print control generate a PDF file.
Ekkk!!. Besides it's loads more work and I'd like to encourage users with outdated browsers to upgrade them.

Re: how to control printing of document with php

Posted: Tue Jul 08, 2008 2:33 pm
by onion2k
From your link - "PDF is great for one thing and one thing only: printing documents."

What's this thread about again Ollie?

:wink:

Re: how to control printing of document with php

Posted: Tue Jul 08, 2008 3:28 pm
by Ollie Saunders
OK. I'll take that. My disdain for PDFs spewed over a bit there.

Re: how to control printing of document with php

Posted: Wed Jul 30, 2008 12:09 am
by Weirdan
Moved to PHP-Code - the question has nothing to do with databases