In the U.S., we need to print a barcode for the full zipcode below the address.
This requires a specific font. I can print a barcode but it is not at all like what I need to use.
I looked at the sample programs, but I use the printer class directly ( not the command lines ), and I have "sort of" translated it to work, but again the output is not correct.
Has anyone used the oPrn:PrintBarCode( ) Method for doing this with mailing labels ?
Postal bar code
- TimStone
- Posts: 2955
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Postal bar code
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- Marc Venken
- Posts: 1485
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Postal bar code
Inside samples BarCod01.
Code: Select all | Expand
function PrintBarCodes()
local oPrn, oFont
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14 OF oPrn
PAGE
@ 1, 1 PRINT TO oPrn TEXT "PDF417" INCHES FONT oFont
@ 1.25, 1 PRINT TO oPrn TEXT "Address :" + CRLF + cName - CRLF - cCity - CRLF - cCountry ;
AS BARCODE TYPE "PDF417" SIZE 4, 0.75 INCHES
@ 3.00, 1 PRINT TO oPrn TEXT cName INCHES FONT oFont
@ 3.30, 1 PRINT TO oPrn TEXT cCity INCHES FONT oFont
@ 3.60, 1 PRINT TO oPrn TEXT cCountry INCHES FONT oFont
@ 3.90, 1 PRINT TO oPrn TEXT cItem INCHES FONT oFont
@ 3.00,5.00 PRINT TO oPrn TEXT "Address :" + CRLF + cName - CRLF - cCity - CRLF - cCountry ;
AS BARCODE TYPE "QR-CODE" SIZE 1.2,1.2 INCHES
@ 5.5, 1 PRINT TO oPrn TEXT TRIM( cName ) ;
AS BARCODE TYPE "CODE128" SIZE 4,1 INCHES
@ 9, 4 PRINT TO oPrn TEXT cItem AS BARCODE TYPE "EAN13" ;
SIZE 4,1 INCHES
ENDPAGE
ENDPRINT
RELEASE FONT oFont
return nil
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
- Marc Venken
- Posts: 1485
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Postal bar code
Sorry Tim,
It's not the method version I see now .....
It's not the method version I see now .....
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
- karinha
- Posts: 7935
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
- karinha
- Posts: 7935
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Postal bar code
// C:\FWH..\SAMPLES\FWBARCOD.PRG - By Nages.
Regards, saludos.
Code: Select all | Expand
#Include "FiveWin.ch"
#define PAD_LEFT 0
#define PAD_RIGHT 1
#define PAD_CENTER 2
STATIC oWnd
FUNCTION Main()
LOCAL oBar
DEFINE WINDOW oWnd TITLE "Printing Barcode"
DEFINE BUTTONBAR oBar _3D OF oWnd
DEFINE BUTTON OF oBar ACTION printbarcode()
SET MESSAGE OF oWnd TO "Printing Barcode" NOINSET CLOCK DATE KEYBOARD
ACTIVATE WINDOW oWnd
RETURN NIL
FUNCTION PrintBarcode()
LOCAL oPrn, oBarcode, oFont
LOCAL cText := "FiveTechSoft"
cText := "15140803532877000111550020000018651000018657"
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "Arial" SIZE 0, -16 BOLD OF oPrn
oPrn:SetPage(9) // A4
// oPrn:SetPortrait() // Vertical
oPrn:SetLandScape()
PAGE
oPrn:cmSay( 2.0, 10.5, cText, oFont,,CLR_BLACK,,PAD_CENTER )
oBarCode := FWER_BarCode():New( oPrn:hDCOut, cText, 700, 100, 3000, 400, 3 )
WITH OBJECT oBarCode
:nBCodeType := 3 // CODE 128
:nPinWidth := 10
:ShowBarCode()
END
ENDPAGE
ENDPRINT
RETURN nil
// FIN / END
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- TimStone
- Posts: 2955
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: Postal bar code
Thanks for responding, but the output is not correct.
U.S. mail barcodes are very specific. They use a special font, and are much thinnner than the output we are achieving with the FW barcode functions/methods.
My label printer software automatically adds them. Microsoft Word also adds them in their mailing program. I've been researching the topic, and know, for example, they are doable in C++, but have not yet attained a solution.
Essentially, the codes are equal in height to a standard print line in a letter.
U.S. mail barcodes are very specific. They use a special font, and are much thinnner than the output we are achieving with the FW barcode functions/methods.
My label printer software automatically adds them. Microsoft Word also adds them in their mailing program. I've been researching the topic, and know, for example, they are doable in C++, but have not yet attained a solution.
Essentially, the codes are equal in height to a standard print line in a letter.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- karinha
- Posts: 7935
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Postal bar code
Dear Tim, Ask at the North American Post Office, if the Code is Two-Dimensional Datamatrix 2D??
Estimado Tim, Pregunte en la oficina de correos de América del Norte si el código es bidimensional Datamatrix 2D?
Thanks
Regards, saludos.
Estimado Tim, Pregunte en la oficina de correos de América del Norte si el código es bidimensional Datamatrix 2D?
Thanks
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- James Bott
- Posts: 4840
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: Postal bar code
Tim,
Check out the "USPS Barcode FAQ & Tutorial" here:
barcodefaq.com/usps-postal/
I have never used postal barcodes, so I can't offer any help with this.
I hope you have already solved your problem.
Check out the "USPS Barcode FAQ & Tutorial" here:
barcodefaq.com/usps-postal/
I have never used postal barcodes, so I can't offer any help with this.
I hope you have already solved your problem.
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
- TimStone
- Posts: 2955
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: Postal bar code
James,
I checked it out, but was not able to print out the proper sized code. It was not critical, so I just moved on.
I checked it out, but was not able to print out the proper sized code. It was not critical, so I just moved on.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit