[SOLVED]How can you send multiple items to printer?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
myleow
Forum Contributor
Posts: 194
Joined: Mon Jun 21, 2004 7:05 pm
Location: California

[SOLVED]How can you send multiple items to printer?

Post by myleow »

Personally i don't think this is possible but since the Boss wants it like that i would have to exhaust all possiblities.

Lets say i have 2 items from the database and there are 2 types of view. A LIST view, which just list each item in a row with a check box in front AND a DETAIL view which is more information on each individual items presented on its own page.

Example of LIST view

Code: Select all

__Check__.......FirstName........LastName...........Email........Balance......
[Check Box].......John..............Doe.........john@doe.com.......$100.......
[Check Box].......Tai...............Boe.........tai@boe.com........$1000......
Example of DETAIL view

Code: Select all

First Name: John
Last Name: Doe
Email: john@doe.com
Invoice Breakdown
.
.
.
.
.
Balance: $100
If you have the DETAIL view on the screen its easy to have to sent to the printer by javascript or just clicking print on your browser.

The question here is when you are in the LIST view, how can you check the 2 things and click on the Print button on the browser and have both items sent to the Printer in their DETAIL view?

The server where this resides is in some Datacenter where the printer is in the office, they aren't in the same Intranet so you can't use PHP's printer module.

Appreciate any help i can get.
Last edited by myleow on Tue Sep 27, 2005 11:33 am, edited 1 time in total.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I'm not sure what you're asking exactly but it sounds like maybe generating a PDF file and sending that to the printer by JavaScript could be a help?
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Post by robster »

What if, on pressing the print button, it were to run a piece of code that pulled those checked entries from the database one at a time in a loop. Then, each time through the loop you send to the printer.

It could be in a popup that opens then auto closes after job has completed. (or even via some kind of refresh)

My thoughts anyway. Hope it helps,

Rob
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

what about dynamically switching the CSS for each around a bit such that the "media" they are attached to is for print or not based on the checkbox status?
myleow
Forum Contributor
Posts: 194
Joined: Mon Jun 21, 2004 7:05 pm
Location: California

Thanks for the help

Post by myleow »

Figured this out in the weekend. Basically i hide information in a DIV and pass them into the JS to form a table with a page break at the end. So however many checkbox i checked for printing it will send it to the printer in individual pages.

Interested... Wouldn't be able to do it with PHP but JS got it done.
Post Reply