473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Writing Barcodes

Hi,

I am trying to write a page that creates some barcodes using the PEAR
Image_Barcode module. I am getting one barcode to write just fine
but it will not print out any more than one and will not print any
text on the page.

What I would like is to pass in the information to be barcoded, and a
category for each barcode, then have a page displayed that groups the
barcodes by category.

Category A
Product 1a barcode
product 2a barcode
..
..
product N barcode

Category B
Product 1b barcode
product 2b barcode

etc...

How do I get it so I can write HTML to the same page as my barcode? I
am writing something very simple to play with this to start and only
one barcode is printing.

<?php
require("Image/Barcode.php");

$bc = new Image_Barcode;

$bc->draw("BE1029", "Code39", "png");
$bc->draw("BE1020", "Code39", "png");
echo "hello"
?>

ultimately, I would like something like

<table>
<tr><td>Category A</td><td>Category B</td><td>Category C</td></tr>
<tr><td>Product Barcode1a</td><td>Product Barcode 1b</td><td>Product
Barcode 1c</td></tr>
etc....

(obviously the code would contain php code for processing and looping,
i am just trying to give an idea of my goal)
Thanks very much for your help.

May 1 '07 #1
3 5946
KDawg44 wrote:
Hi,

I am trying to write a page that creates some barcodes using the PEAR
Image_Barcode module. I am getting one barcode to write just fine
but it will not print out any more than one and will not print any
text on the page.
<----- SNIP -------->
>
How do I get it so I can write HTML to the same page as my barcode? I
am writing something very simple to play with this to start and only
one barcode is printing.

<?php
require("Image/Barcode.php");

$bc = new Image_Barcode;

$bc->draw("BE1029", "Code39", "png");
$bc->draw("BE1020", "Code39", "png");
echo "hello"
?>
<----- SNIP -------->
>
IMHO, because the class from PEAR actually putting out an image, it
ultimately behaves as an image contenttype=image/png (or something like
that).

So in order to have 2 or more barcodes on your page, or text, you chould
write another php (even html) that utilizes that your current barcode
script.

Example:
create-barcode.php
<?php
require("Image/Barcode.php");
$bc = new Image_Barcode;
$bc->draw($_REQUEST['param1'], $_REQUEST['param2'], "png");
?>
index.html
<html>
<!-- This is the first barcode -->
<img src="create-barcode.php?param1=BE1029&param2=Code39" />
<!-- This is the second barcode -->
<img src="create-barcode.php?param1=BE1020&param2=Code39" />
<!-- This is just text -->
Hello
</html>
PLEASE NOTE: That the script that i put there is just an example of how
it can be done, without the consideration of other security measures.

Hendri Kurniawan
May 1 '07 #2
On May 1, 5:37 pm, Hendri Kurniawan <ask...@email.comwrote:
KDawg44 wrote:
Hi,
I am trying to write a page that creates some barcodes using the PEAR
Image_Barcode module. I am getting one barcode to write just fine
but it will not print out any more than one and will not print any
text on the page.

<----- SNIP -------->
How do I get it so I can write HTML to the same page as my barcode? I
am writing something very simple to play with this to start and only
one barcode is printing.
<?php
require("Image/Barcode.php");
$bc = new Image_Barcode;
$bc->draw("BE1029", "Code39", "png");
$bc->draw("BE1020", "Code39", "png");
echo "hello"
?>

<----- SNIP -------->

IMHO, because the class from PEAR actually putting out an image, it
ultimately behaves as an image contenttype=image/png (or something like
that).

So in order to have 2 or more barcodes on your page, or text, you chould
write another php (even html) that utilizes that your current barcode
script.

Example:
create-barcode.php
<?php
require("Image/Barcode.php");
$bc = new Image_Barcode;
$bc->draw($_REQUEST['param1'], $_REQUEST['param2'], "png");
?>

index.html
<html>
<!-- This is the first barcode -->
<img src="create-barcode.php?param1=BE1029&param2=Code39" />
<!-- This is the second barcode -->
<img src="create-barcode.php?param1=BE1020&param2=Code39" />
<!-- This is just text -->
Hello
</html>

PLEASE NOTE: That the script that i put there is just an example of how
it can be done, without the consideration of other security measures.

Hendri Kurniawan
Thanks very much!

May 2 '07 #3
On May 2, 1:38 pm, KDawg44 <KDaw...@gmail.comwrote:
On May 1, 5:37 pm, Hendri Kurniawan <ask...@email.comwrote:
KDawg44 wrote:
Hi,
I am trying to write a page that creates some barcodes using the PEAR
Image_Barcode module. I am getting one barcode to write just fine
but it will not print out any more than one and will not print any
text on the page.
<----- SNIP -------->
How do I get it so I can write HTML to the same page as my barcode? I
am writing something very simple to play with this to start and only
one barcode is printing.
<?php
require("Image/Barcode.php");
$bc = new Image_Barcode;
$bc->draw("BE1029", "Code39", "png");
$bc->draw("BE1020", "Code39", "png");
echo "hello"
?>
<----- SNIP -------->
IMHO, because the class from PEAR actually putting out an image, it
ultimately behaves as an image contenttype=image/png (or something like
that).
So in order to have 2 or more barcodes on your page, or text, you chould
write another php (even html) that utilizes that your current barcode
script.
Example:
create-barcode.php
<?php
require("Image/Barcode.php");
$bc = new Image_Barcode;
$bc->draw($_REQUEST['param1'], $_REQUEST['param2'], "png");
?>
index.html
<html>
<!-- This is the first barcode -->
<img src="create-barcode.php?param1=BE1029&param2=Code39" />
<!-- This is the second barcode -->
<img src="create-barcode.php?param1=BE1020&param2=Code39" />
<!-- This is just text -->
Hello
</html>
PLEASE NOTE: That the script that i put there is just an example of how
it can be done, without the consideration of other security measures.
Hendri Kurniawan

Thanks very much!
I don't know anything about PEAR but I seem to remember that www.fpdf.org
includes a php script for outputting barcodes to PDF. It might be
worth a look.

May 2 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Murray Elliot | last post by:
Just wondering if anyone has any ideas on how to solve a particular problem. A client wants to print barcode labels from their (web/php based application). The barcode labels are very small, so I'm...
1
by: David Chapman | last post by:
I need to print barcodes with normal characters on labels from my which has a VB.net front end. The database is a library system, the barcode represents the bookid - the isbn is not used. The book...
2
by: Dale Geffs | last post by:
I have a need to print barcodes from database fields. What is everyone using these days to do this? I haven't used barcodes since my dBase days almost 15 years ago. What's new? Dale
1
by: MDB | last post by:
Hello All, I am trying to figure out how to dynamically create and display barcodes in a web form. Can anyone point me in the right direction or give me an example? Due to budget issues, I...
1
by: DeanL | last post by:
Hi all, This is probably not the group for this but I'm not sure quite where else to go. Does anyone know where to find the barcode standards for FedEx shipments of all types of shipping they...
1
by: toolinventory | last post by:
I'm a newbie and I have to take data from access (inventory), put the table into a label-making software. Then I need to find a way to scan the barcodes and have that call up the data in access....
3
by: Peter Timbol | last post by:
i am new to barcode programming, how can i use barcodes in my MSaccess database? how can i initialize the device and read barcodes?
7
by: Burhan | last post by:
Hello Group: I am in the planning stages of an application that will be accessed over the web, and one of the ideas is to print a barcode that is generated when the user creates a record. The...
2
by: zafar | last post by:
Hi there, I need to print barcodes using IDs which are used in my system. I need some help how to print barcodes (any type EAN-13, EAN-8, Code 39 etc etc). If there is any free DLL available for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.