Post Net Bar Code 
Author Message
 Post Net Bar Code

I believe the easiest way would be to find an font that uses the postal bar
code.  I believe I saw it on a font web site some where once and several
packages are for sale.


Quote:
> I am using Visual Basic v 4.0 and have written a data base program and
> need to be able to print Post Net Bar Codes from within the program.  I
> have the info about the bar combination for each number and the check
> bit but don't know how to create the data for each number.  In other
> words, I need the data to be able to create the short and tall bars and
> how to place this info in a string whereby I can print the bar code from
> within my program at any place on the paper.

> Thank you,

> Jim Roberts




Thu, 13 Sep 2001 03:00:00 GMT  
 Post Net Bar Code
I am using Visual Basic v 4.0 and have written a data base program and
need to be able to print Post Net Bar Codes from within the program.  I
have the info about the bar combination for each number and the check
bit but don't know how to create the data for each number.  In other
words, I need the data to be able to create the short and tall bars and
how to place this info in a string whereby I can print the bar code from
within my program at any place on the paper.

Thank you,

Jim Roberts



Fri, 14 Sep 2001 03:00:00 GMT  
 Post Net Bar Code
Here is the code to make Postnets in MsAccess97.  Use MsAccess report.
---
Option Compare Database   'Use database order for string comparisons
'
' PostNet Generator for United States Postal Service PostNet & FIM
Barcodes
'
' version 2.0 (updated for MsAccess 97)
'
' (c) 1993-1999 James Isle Mercanti, Cocoa Beach, FL 32931  USA
' Permission granted for public use and royalty-free distribution.
' No mention of source or credits is required. All rights reserved.
'
' TO USE THIS CODE:
'
'   1 - Create Report with a TextBox control. (example named
PostNetCode)
'       Make sure the Visible property is set to "No".
'   2 - Set On-Print property of section to [Event Procedure]
'       by clicking on the [...] and selecting "Code Builder"
'   3 - Confirm that the following code matches yours...
'
'      Sub Detail1_Print (Cancel As Integer, PrintCount As Integer)
'
'         Result = MD_PostNet(PostNetCode, Me)
'
'      End Sub
'
'   4 - NOTE: The name of the section is "Detail1" for example only!
'
'   5 - NOTE: The field PostNetCode represents 5-, 9-, or 11-digit
'           ZIP code with a correction character.  The 9-digit is
'           Zip+4, and the 11-digit includes Delivery Point BarCode
'           (DPBC) which represents the last 2 numbers of the street
'           address, post office box, rural route, or hwy route number.
'           The function MD_PostNetCode([PostalCode],[Address]) is used
'           to extract these codes along with the correction character.
'           This is why the PostNetCode field makes reference to this.
'           For more information consult the USPS Publication 25. The
'           location of this barcode can be moved above the address
'           block.  Refer to Pub. 25 for more information on this also.
'
'           PostFimCode has been added for bulk mailers.  This field is
'           set to "A", "B", "C", or blank.  Refer to Pub. 25 for more
'           information on the use of this code along with PostNet.
'           The field control.source is hardcoded but can point to a
table.
'
Option Explicit
'

Function MD_PNet(CharCode As Integer) As String

    On Error GoTo ErrorTrap_PNet

    ReDim PNet(10)

    PNet(0) = "11000" ' 0
    PNet(1) = "00011" ' 1
    PNet(2) = "00101" ' 2
    PNet(3) = "00110" ' 3
    PNet(4) = "01001" ' 4
    PNet(5) = "01010" ' 5
    PNet(6) = "01100" ' 6
    PNet(7) = "10001" ' 7
    PNet(8) = "10010" ' 8
    PNet(9) = "10100" ' 9

    MD_PNet = PNet(CharCode)

Exit_PNet:
    Exit Function

ErrorTrap_PNet:
    MD_PNet = ""
    Resume Exit_PNet

End Function

Function MD_PostFIM(Ctrl As Control, Rpt As Report) As Integer

    On Error GoTo ErrorTrap_PostFIM

    Dim Lbar As Single, Hbar As Single, Wbar As Single
    Dim CountX As Single, NextBar As Single
    Dim Color As Long, PostFIM As Variant
    Dim Stripe As String
    Dim Sx As Single, Sy As Single
    Const White = 16777215: Const Black = 0

    Sx = Ctrl.Left: Sy = Ctrl.Top

    Select Case Ctrl
        Case "A"
            PostFIM = "110010011"
        Case "B"
            PostFIM = "101101101"
        Case "C"
            PostFIM = "110101011"
        Case Else
            PostFIM = "000000000"
    End Select

    Lbar = 0
    Hbar = (1440 * (5 / 8))
    Wbar = (1440 * 0.031)

    NextBar = Sx

    For CountX = 1 To Len(PostFIM)
        Stripe = Mid(PostFIM, CountX, 1)

        Color = Black
        Select Case Stripe
            Case "1"
                Rpt.Line (NextBar, Sy)-Step(Wbar, Hbar), Color, BF
                NextBar = NextBar + Wbar    'Bar
            Case "0"
                NextBar = NextBar + Wbar    'NoBar
        End Select

        NextBar = NextBar + Wbar    'NoBar

    Next CountX

Exit_PostFIM:
    Exit Function

ErrorTrap_PostFIM:
    Resume Exit_PostFIM

End Function

Function MD_PostNet(Ctrl As Control, Rpt As Report) As Integer

    On Error GoTo ErrorTrap_PostNet

    Dim Lbar As Single, Hbar As Single, Wbar As Single, Sbar As Single
    Dim CountX As Single, CountY As Single, NextBar As Single
    Dim Color As Long, PostNet As Variant
    Dim Stripes As String, OneStripe As String
    Dim Sx As Single, Sy As Single
    Const White = 16777215: Const Black = 0
    Const cYield = 1440

    Sx = Ctrl.Left: Sy = Ctrl.Top
    PostNet = Ctrl
    Lbar = (cYield * 0.05): Hbar = (cYield * 0.125)
    Wbar = (cYield * 0.02): Sbar = (cYield * 0.05)

    NextBar = Sx

    Color = Black
    Rpt.Line (NextBar, Sy)-Step(Wbar, Hbar), Color, BF
    NextBar = NextBar + Sbar    'HighBar

    For CountX = 1 To Len(PostNet)
        Stripes = MD_PNet(Mid(PostNet, CountX, 1))
        For CountY = 1 To 9
            OneStripe = Mid$(Stripes, CountY, 1)
            Color = Black
            Select Case OneStripe
                Case "1"
                    Rpt.Line (NextBar, Sy)-Step(Wbar, Hbar), Color, BF
                    NextBar = NextBar + Sbar    'HighBar
                Case "0"
                    Rpt.Line (NextBar, Sy + (Hbar - Lbar))-Step(Wbar,
Lbar), Color, BF
                    NextBar = NextBar + Sbar    'LowBar
            End Select
        Next CountY

    Next CountX

    Color = Black
    Rpt.Line (NextBar, Sy)-Step(Wbar, Hbar), Color, BF
    NextBar = NextBar + Sbar    'HighBar

Exit_PostNet:
    Exit Function

ErrorTrap_PostNet:
    Resume Exit_PostNet

End Function

Function MD_PostNetCode(PostalCode, Address) As String

    Dim ZipCode As String, PostNetCode As String
    Dim x As Integer, DPoint As String

    If Len(PostalCode) > 5 Then
        ZipCode = Format$(PostalCode, "000000000")
    Else
        ZipCode = Format$(PostalCode, "00000")
    End If

    For x = 1 To Len(Address)
        If IsNumeric(Mid(Address, x, 1)) Then Exit For
    Next x

    If x <> Len(Address) Then
        DPoint = Format$(Right$(Format$(Val(Mid(Address, x))), 2), "00")
    Else
        DPoint = ""
    End If

    If Len(ZipCode) = 5 Then
        PostNetCode = ZipCode
    Else
        PostNetCode = ZipCode & DPoint
    End If

    MD_PostNetCode = PostNetCode & MD_PostNetCorrection(PostNetCode)

End Function

Function MD_PostNetCorrection(PostNetCode) As String

    Dim CheckSum As Integer, x As Integer, Correction As Integer

    For x = 1 To Len(PostNetCode)
        CheckSum = CheckSum + Val(Mid(PostNetCode, x, 1))
    Next x

    Correction = 10 - (CheckSum Mod 10)
    If Correction = 10 Then Correction = 0

    MD_PostNetCorrection = Format$(Correction)

End Function



Fri, 14 Sep 2001 03:00:00 GMT  
 Post Net Bar Code
The company that I work for sells a set of bar code DLLs that generate
exceptionally high quality bar code graphics as windows metafiles. The
DLLs also do everything for you including calculating check digits and
all the other important features of a bar code.
If you are looking to create perfect bar codes that will print
perfectly on any printer, then our DLLs are the best solution
available. If you are interested, please visit http://www.taltech.com
I believe that we have a nice demo of each package in the Free
Software section of the web site including sample VB code.
The demo comes with a sample Code 39 bar code DLL (not a PostNet DLL)
however you can at least see how things work. Our PostNet bar code DLL
is $295.



Quote:
>I am using Visual Basic v 4.0 and have written a data base program and
>need to be able to print Post Net Bar Codes from within the program.  I
>have the info about the bar combination for each number and the check
>bit but don't know how to create the data for each number.  In other
>words, I need the data to be able to create the short and tall bars and
>how to place this info in a string whereby I can print the bar code from
>within my program at any place on the paper.

>Thank you,

>Jim Roberts




Fri, 21 Sep 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Post Net Bar code printing on Epson action 5000 printer

2. Post Net Bar Code printing

3. vb.net code transform to asp.net code?

4. Progress bar in status bar for .NET

5. international post codes (Zip codes) - ricerca tabella codici postali europei per database

6. Vb code to print 2D bar-code

7. code 39 bar code

8. Bar CODE VBX or Info, CODE, I/O info for VB 3.0

9. Code to print 2D bar-code

10. How to Code a Bar Code Printout

11. Asp.net Invisible Form Post

12. Microsoft: Please post Q182598 fix for .NET

 

 
Powered by phpBB® Forum Software