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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bar Code Printing in Micro Size on Label

mstrcmtr

Programmer
Joined
Nov 14, 2007
Messages
106
Location
PK
Printer Name: 4BARCODE 4B-2054K

Problem: On Bar Code Printer print Bar Code sticker in Micro size

Using the following Code showing okay in Print Preview

Downloaded the Font Code128 and copy in C:\Windows\Fonts Folder

LOCAL lo_Fbc

lo_Fbc = CREATEOBJECT("FoxBarcode")

*-- Object Properties
WITH lo_Fbc

.cFontName = "Arial"

.cSet128 = "*"

.lFontBold = .T.
.nAlignText = 1

.nBarcodeType = 110

*.nFactor = 2

.nFontSize = 10.5
.nImageHeight = 40

.cText = "Code128"
* .cText = "Free3of9"
* .cText = "IDAutomationHC39M Free Version"
* .lShowHumanReadableText = .F.
ENDWITH

ln_Chk_P_No = 1
ln_Chk_Rctngl_Box = 1

CREATE CURSOR Tc_Bar_C_2(Acitno I , PrtNo C(16) , Bar_C_13 C(13) )

INSERT INTO Tc_Bar_C_2 VALUES (42 , '1ARO WATER SWIWW' , '0000000000042' )

SELECT Tc_Bar_C_2

GO TOP IN Tc_Bar_C_2

LABEL FORM Item_Stckr_Qih_038_W_25_H_LO_1.Lbx TO PRINTER PROMPT PREVIEW

CLOSE ALL

CLEAR ALL

RETURN
 
Ok, and what is the problem?
From your description, it is not clear to me whether you want to print in MicroSize or whether your printout is too small.
If the latter, there was a problem with VFP reports and a screen-scaling different from 100%. Check your windows settings.
Also: what is your setting for SET REPORTBEHAVIOR? 80 or 90 ?
And why would you need that FONT128 in your Windows directory? That FoxBarcode class generates the whole image, no need for a special font.
Where are you generating that image with the "loFbc.BarcodeImage(Tc_Bar_c_2.Bar_C_13) " code?

BTW: That "SELECT TC_Bar_C_2" isn't necessary, because you are already focussed on that just created cursor.
That "GO TOP" is also not necessary, since any table-related command without a FOR condition will always start from top.
 
Last edited:
Sorry

I illustrate my problem

Bar Code and other controls all are Printing in a Micro size instead of Normal viewable Size like showing in Print Preview of Label

Using

SET REPORTBEHAVIOR 90

For this
lo_Fbc.BarcodeImage(Tc_Bar_c_2.Bar_C_13)

I have attached label file in which you check command in a Picture/Ole Bound control
with scale contents , retain shape in General Tab of Ole control
 

mstrcmtr:​

  • Do you use VFP 9 or VFP A?

  • What is DPI size (text size in windows - 100%, 120%, 150%, 175% or custom size)?

MartinaJ
 
I have attached label file in which you check command in a Picture/Ole Bound control
with scale contents , retain shape in General Tab of Ole control
Hmm, I don't see anything attached ?
 
I am using VFP9 with SP2

attaching a Zip file containing Prg and Label files

Display set to

Scale 100%
Display resolution 1600 * 900
Display Orientation Landscape
 

Attachments

Preview zoomed to 300%:
1751364072937.png

Screenshot of PDF viewer in 300% zoom:
1751364131095.png
Same, same - except a bit of quality difference mainly in the numeric part of the barcode graphic, a bit blurry barcode lines, too. I guess this would be controllable by quality settings of the PDF conversion. I just used the Microsoft Print To PDF for this. But I don't see a general problem like much smaller barcode graphics in the PDF than in preview. Or is it that you want higher barcodes so the frame is fully filled? Then just increase the .nImageHeight to something higher.

Also, try with different printers to see if the problem isn't in your printer settings.
 
Last edited:
Printer Name: 4BARCODE 4B-2054K

Problem: On Bar Code Printer print Bar Code sticker in Micro size

Using the following Code showing okay in Print Preview

Downloaded the Font Code128 and copy in C:\Windows\Fonts Folder

LOCAL lo_Fbc

lo_Fbc = CREATEOBJECT("FoxBarcode")

*-- Object Properties
WITH lo_Fbc

.cFontName = "Arial"

.cSet128 = "*"

.lFontBold = .T.
.nAlignText = 1

.nBarcodeType = 110

*.nFactor = 2

.nFontSize = 10.5
.nImageHeight = 40

.cText = "Code128"
* .cText = "Free3of9"
* .cText = "IDAutomationHC39M Free Version"
* .lShowHumanReadableText = .F.
ENDWITH

ln_Chk_P_No = 1
ln_Chk_Rctngl_Box = 1

CREATE CURSOR Tc_Bar_C_2(Acitno I , PrtNo C(16) , Bar_C_13 C(13) )

INSERT INTO Tc_Bar_C_2 VALUES (42 , '1ARO WATER SWIWW' , '0000000000042' )

SELECT Tc_Bar_C_2

GO TOP IN Tc_Bar_C_2

LABEL FORM Item_Stckr_Qih_038_W_25_H_LO_1.Lbx TO PRINTER PROMPT PREVIEW

CLOSE ALL

CLEAR ALL

RETURN
I'm not familiar with the Label Form command, nor with the 'FoxBarcode' object.
However we have been using IDAutomation fonts (I25, C39, etc.) for shipping labels for decades, since the FoxBase days; and the same coding is working with VFP 9.0 now (we do have a paid version of IDAutomation font set)
What we do is format the label with the standard Report Form, bind the report to the destination label printer, and simply set the field to be barcoded (Item#, PO#,etc) to the proper IDAutomation font (which will appear in style pick list along with all other fonts); and it runs just like any other report forms.

Hope this helps.
 
As an additional possibility: have you downloaded the newest printing apps?
There have been several cumulative updates, and this one could fit your problem:
"2014.07.04 Release This release fixes a bug in ReportOutput.app and ReportBuilder.app that didn't handle higher DPI displays properly"

https://github.com/VFPX/ReportingApps
Click on that green "Code" button and then "Download ZIP"
 
Steve, labels are in fact quite the same as reports, just with lbx file extension and by default a format that fits label sheets. with several columns and rows. The designer designs one label of a sheet only. Many use endless paper labels instead of sheets when it comes to mass label printing and then it means one column of labels. Anyway, technically label and report are quite the same.

And they are also handled by the report apps and reportengine setting 80 or 90.

FoxBarcode is part of VFPX: https://github.com/VFPX/FoxBarcode
 

Part and Inventory Search

Sponsor

Back
Top