Page 1 of 1

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

Posted: Thu Sep 22, 2005 6:28 pm
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.

Posted: Thu Sep 22, 2005 7:03 pm
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?

Posted: Thu Sep 22, 2005 7:20 pm
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

Posted: Thu Sep 22, 2005 7:38 pm
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?

Thanks for the help

Posted: Tue Sep 27, 2005 11:32 am
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.