|
użytkowników online: 57
|
OPINIE UŻYTKOWNIKÓW
|
Gratulacje i dzięki! Trafiłem tu przypadkiem poszukując informacji na temat php+mysql. Wiele polskich stron powiela identyczne przykłady, klonuje te same kursy i lekcje... ten serwis okazał sie inny. Zasada "problem - rozwiazanie - wyjaśnienie" zdaje egzamin - zapewnia jasną, jednoznaczną i pewną pomoc w konkretnym przypadku. Porady są warte swojej ceny, przede wszystkim ze względu na przyjazną (także dla początkujących) formę i treść oraz bogate i stale powiększane zasoby. Polecam i pozdrawiam!
Kamil Dmowski
Polski Czerwony Krzyż
|
|
PODRĘCZNIK PHP 5.x, 4.x, 3.x - częściowo spolszczony / źródło: www.php.net
[Spis]
[A]
[B]
[C]
[D]
[E]
[F]
[G]
[H]
[I]
[J]
[K]
[L]
[M]
[N]
[O]
[P]
[Q]
[R]
[S]
[T]
[U]
[V]
[X]
[W]
[Z]
CII. Printer Functions
These functions are only available under Windows 9.x, ME, NT4 and
2000. They have been added in PHP 4.0.4.
This PECL extension is not bundled with PHP.
Windows users must enable php_printer.dll inside
of php.ini in order to use these functions.
To rozszerzenie
PECL można pobrać osobno z wielu stron z migawkami
PECL (nalezy wybrać repozytorium odpowiednie dla posiadanej
wersji PHP): PECL dla PHP
4.3.x, PECL dla PHP 5.0.x
lub PECL Unstable.
Na działanie tych funcji wpływają ustawienia zawarte w pliku
php.ini.
Tabela 1. Printer configuration options | Name | Default | Changeable | Changelog |
|---|
| printer.default_printer | "" | PHP_INI_ALL | |
Szczegóły i definicje dotyczące stałych
PHP_INI_* znajdują się w rozdziale Dodatek H.
User Contributed Notesarne dot briesenick at soxabo dot de
28-Sep-2004 04:42
Printing in UN*X is possible too:
<?php
function lpr($STR,$PRN) {
$prn=(isset($PRN) && strlen($PRN))?"$PRN":C_DEFAULTPRN ;
$CMDLINE="lpr -P $prn ";
$pipe=popen("$CMDLINE" , 'w' );
if (!$pipe) {print "pipe failed."; return ""; }
fputs($pipe,$STR);
pclose($pipe);
} ?>
You pipe the stream/string/char/sign whatever to the system. In the example shown above you have to add at least the string for printing in the function call. The second arg is a printer name which if you don't set will be set to the C_DEFAULTPRN. This is a constant definition from an ini file.
Hope this will help to save a lot of time ;-)
jason at matteson dot com
12-Mar-2004 12:01
You can print in XP. AND, you can print to a shared printer with XP. The drivers for the printer MUST be installed on ther server as well as on the computer you wish to print with. Also, the printer must be shared on the client computer.
I am using a Zebra LP2844 Thermal Barcode Printer in my application. I am running XP Pro,Apache 1.3.27, PHP 4.3+.
Here is a function I use in our churches checkin system. I use this to print directly to our printer with out having to use any Javascript.
First, i give the function the name of the shared printer.
Second, I get the client computers host name. You could use just REMOTE_ADDR too I suppose.
Then I return a correctly formatted Windows path to the shared printer for the
function getPrinter($SharedPrinterName) {
global $REMOTE_ADDR;
$host = getHostByAddr($REMOTE_ADDR);
return "\\\\".$host."\\".$SharedPrinterName;
}
$handle = printer_open(getPrinter("Eltron"));
So, as long as you KNOW the computers are suppose to have a shared printer called "Eltron", you're all set to start sending info to the printer with the other Printer functions.
-j
macagomez at yahoo dot com
27-Jul-2003 11:35
Please notice that what is printed is NOT measured in pixels, it is measured in pronter's dots.
Apply to fonts, coordinates and bit maps.
HW
04-May-2003 12:31
Should be pretty obvious, but in case there is any confusion...
The printer in question is one that is connected to the _server_, not the _client_.
jwlash at acm dot org
20-Feb-2003 08:40
I have noticed the for unix based systems you can also do this:
system("lp $filename")
:)
surak at surak dot eti dot br
04-Feb-2003 07:30
[Editor's Note]
There is another free one available at http://www.fpdf.org/
[/Note]
As Bert said, a pdf generator wouldn't be bad. There is a free one at http://www.ros.co.nz/pdf/ , which can do the job. Inspite of the fact it is a little bit rough, it works fine and quite fast. It's just a matter of throwing the pdf file to ghostscript print it.
bertATnerdstockDOTorg
21-Jan-2003 01:22
If you want to address the printer from your PHP-application in a Un*x environment:
This is possible if you use a different method.
In Unix it would not be logical to address your printer directly from php, but you could for instance generate a PDF-file with PDFlib (or a textfile, or a PNG/JPEG image with GD or what have you) and write it from your php-script to a directory that you use as a "printer-outbox."
Next, you write a shellscript that calls some unix tool to print all pdf or other documents in your "outbox" directory and then deletes all files in that directory.
Then you use crontab to run this script every minute or as often as you think it's neccessary.
You could of course also call the shellscript from your php-application with exec() but you'll probably want to avoid using exec() and the like for security reasons.
kincaic at swbell dot net
22-May-2002 06:23
The X and Y co-ordinates are in dots.
Get the printer resolution BEFORE printing anything and convert all co-orditantes to dots in the current resolution.
Trying to change the resolution does NOT work in Win2000.
Anybody know where the source to php_printer.dll is kept? I would like to fix some of the bugs that I have found.
|