Forum Moderators: coopster

Message Too Old, No Replies

Printing to a printer connected to the server

printer networked php

         

zumbrujm

6:10 pm on Jul 10, 2009 (gmt 0)

10+ Year Member



Hello,

Summary:
I am attempting to process a form, use that information to create a product label, and then have that label printed.

Background: My plan is to have the receiving dept. fill in all the details for incoming raw materials using a web browser form. When they click submit it will send the form to the server, where the data will be processed. Right now I'm planning on using FPDF to generate a pdf of the label. Then, I will have the server print to the label printer via a really long printer cable, or by hooking the printer to a workstation and sharing it over the network. The server is running phpMyadmin on Ubuntu 9.04, and the clients will be running XP.

Questions:
1. Is pdf creation the best method for making a product label with PHP?

2. Using FPDF there appears to be an option for setting the page size. What am I doing wrong here?


$pagesize=array();
$pagesize[0]='3';
$pagesiez[1]='4';
$pdf=new PDF('P','in',$pagesize);

[fpdf.org...]

3. The PHP Printer functions only work on Windows, so how do I print this from the server? Would this require a different language than PHP?

Thanks for the help, I really appreciate any direction, or guidance on places to look.

eelixduppy

2:18 am on Jul 31, 2009 (gmt 0)




1. Is pdf creation the best method for making a product label with PHP?

No clue, I have never made product labels with PHP before. ;)


2. Using FPDF there appears to be an option for setting the page size. What am I doing wrong here?

Should be using integers here, other than that I am unsure...


$pdf=new PDF('P','in',array(3,4));


3. The PHP Printer functions only work on Windows, so how do I print this from the server? Would this require a different language than PHP?

Odds are you are going to have to use a Unix command (ie 'lp') to print the files that you want. You are going to have to use the execution functions: [php.net...]

Good luck, and Welcome to WebmasterWorld! :)

zumbrujm

12:22 pm on Jul 31, 2009 (gmt 0)

10+ Year Member



I found a piece of windows software called BarTender which allows the user to design product labels for multiple uses. It runs a service in the background which constantly checks if a text document containing delimited data has been added to the scan directory. If it has, it prints out a label with the corresponding format. This is really nice because someone without programming experience can very easily change the layout at a later date.

You were definitely right about using numbers, not strings. I think I also had a variable misspelled.

I ended up using the execute() function to call a batch file. Thanks!

John