Hi,
so what if seen in the comments is:
- you cannot use images created before, which are embedded in the html by using an
<img />
-tag
- you cannot include additional fonts to create the barcode (does not work)
To #1: Is not not possible, because you cannot store images? If this is the reason, try using online code creators like barcodesinc, e.g.:
http://www.barcodesinc.com/generator/image.php?code=Hello World&style=197&type=C128B&width=200&height=50&xres=1&font=3
Example:
If you cannot rely on external service providers, there are free classes for your avail for free on the web, e.g. Barcode Generator. Deploy on a web server and use a tag like <img src="http://myserver/myscript.php?code=HelloWorld"/>
pointing to this script. html2ps is supporting rendering inline images.
There is also an open source postscript barcode writer available at http://www.terryburton.co.uk/barcodewriter/. After using html2ps you could manipulate the ps files and embed the barcodewriter directive, e.g.:
50 450 moveto (978-1-86074-271) (includetext) /isbn /uk.co.terryburton.bwipp findresource exec
To #2: Could you provide an error message? At which stage do you have problems?
Ehmm... #3: Using only html + css (would only use if all others fail)
Barcodes can be created using simple css and span-elements:
<style>
.barcode {
border:5px solid white;
background:white;
width:310px;
text-align:center;
}
.ns{
border-left:2px solid white;
height:30;
}
.nb{
border-left:2px solid black;
height:30;
}
.ws{
border-left:5px solid white;
height:30;
}
.wb{
border-left:5px solid black;
height:30;
}
</style>
<div class='barcode' id='bcx2_bc' ><span class='nb'></span><span class='ws'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='wb'></span><span class='ws'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ws'></span><span class='nb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ws'></span><span class='nb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='wb'></span><span class='ws'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='nb'></span><span class='ws'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='nb'></span><span class='ws'></span><span class='wb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='nb'></span><span class='ws'></span><span class='wb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ws'></span><span class='nb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='nb'></span><span class='ws'></span><span class='nb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='wb'></span><span class='ns'></span><span class='nb'></span><span class='ns'></span><br>TEST8052</div>
Example:
This code was created using HTML Bar Codes, also a php class. You could either
- call this via command line interface and embed it into your normal html for every html-page (for dynamic barcodes)
- create your code once using cli/server and put it into your html hard coded (only suitable if your barcode shall not change with every html-page)
I cannot image any other possiblities.