PHP to access shell script to print barcodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to replicate the functionality that I see on this site:

http://blog.maniac.nl/webbased-pdf-lto-barcode-generator/

Notice after you hit SUBMIT QUERY, you get a PDF file with a page of barcodes.  That's _exactly_ what I'm after.
Fortunately, the author gives step-by-step instructions on how to do this on this page:

http://blog.maniac.nl/2008/05/28/creating-lto-barcodes/


So I've gotten through all the steps, and have created the "barcode_with_samples.ps" file, and have it hosted here:

http://www.winecarepro.com/kiosk/fast/shell/

Notice how the last few lines contain the shell-script that renders the postscript:

#!/bin/bash

BASE=”100″;
NR=$BASE

for hor in 30 220 410
do
ver=740
while [ $ver -ge 40 ];
do
printf -v FNR “(%06dL3)” $NR
echo “$hor $ver moveto $FNR (includetext height=0.55) code39 barcode”
let ver=$ver-70
let NR=NR+1
done
done


I need to somehow create a PHP script that "executes" this shell script.  And after doing some research, it sounds like
I need to use the PHP exec command, so I do that with the following file:

http://www.winecarepro.com/kiosk/fast/shell/printbarcodes.php

Which has the following script:

<?php 

$command="http://www.winecarepro.com/kiosk/fast/shell/barcode_with_sample.ps";;
exec($command, $arr);

echo $arr;

?>


And, as you can see, nothing works.  I guess firstly, I'd like to know:

A)  Is this PHP exec call really the way to go with executing this shell script?  Is there a better way?  It seems to me like it's not really executing.
B)  Can someone try following the 5 steps listed on the website (http://blog.maniac.nl/2008/05/28/creating-lto-barcodes/) and tell me if you have any better luck?  It doesn't really sound all that difficult.  I'm hosting this on Dreamhost, and I'm not sure if there's some sort of permissions/shell exec feature I need to make this work.  I'm not convinced that I really have a functioning Postscript file.  My Mac renders Postscript files automatically after downloading with the Preview app, and I'm not seeing any valid data returned.



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux