Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print barcode directly from vfp8

Status
Not open for further replies.

SHERIFOX

Programmer
Sep 20, 2004
1
EG
i want to print barcode labels (spicially ean(13)) from vfp8 using a normal laser printer without need to run any third party program.

thanx 4 help
 
yes, you can do this as long as the barcode font is installed on the computer and that the desired object is set to that barcode font.

peace! [peace]

kilroy [trooper]
philippines

"Illegitimis non carborundum!"
 
Keep in mind that some barcode symbologies (such as UPC, etc.) REQUIRE a checksum character at the end.

Using a simple barcode font will indeed automatically convert human readable characters into a barcode font 'character', but it will not auto-generate the checksum character.

Additionally some barcode symbologies such as Interleave 2 of 5 will 'interleave' 2 characters into the physical space typically occupied by 1 character. To do that you will need to ALWAYS send it pairs of characters.

I might suggest that you consider locating "known", good barcodes so that you can test your VFP newly generated barcodes against an industry standard and, in so doing, be able to test the viability of the VFP generation.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
For code 128 use the following code to encode your text.

The next line is copied from a label form text box which you can use with the function below this.

CHR(135)+ALLT(Citem_Labels.Sample_Id)+CHR(code128(Citem_Labels.Sample_Id))+CHR(138)


** Copy this code into a .prg file
** and use it to add the
** check digit.
** (RTurek)
FUNCTION Code128
PARAMETER CodeValue

mDigit=103
FOR m=1 to LEN(ALLT(CodeValue))
mDigit=mDigit+((ASC(SUBSTR(CodeValue,(m),1))-32)*(m))
ENDFOR
mChk_digit=MOD(mDigit,103)+32

DO CASE
CASE mChk_digit=32
mChk_digit=192
CASE mChk_digit=39
mChk_digit=193
CASE mChk_digit=96
mChk_digit=194
CASE mChk_digit=127
mChk_digit=195
CASE mChk_digit=128
mChk_digit=196
CASE mChk_digit=129
mChk_digit=197
CASE mChk_digit=130
mChk_digit=198
CASE mChk_digit=131
mChk_digit=199
CASE mChk_digit=132
mChk_digit=200
CASE mChk_digit=133
mChk_digit=201
ENDCASE

RETURN mChk_digit


The more I learn the more I find I know nothing.

Rob
 
PS the font we used specifically is Code128A (C128att2.ttf) and the size matters! We use font size 18 & style regular. You can play with other sizes but trust me its a pain in the butt. Also we use the expression above in a field type and sometimes duplicate 2 to make the barcode taller. If you have any questions just ask.

The more I learn the more I find I know nothing.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top