Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply patch 18 Australia Post Barcode #2

Open
SingingBush opened this issue Mar 7, 2020 · 0 comments
Open

apply patch 18 Australia Post Barcode #2

SingingBush opened this issue Mar 7, 2020 · 0 comments
Labels
svn patch A patch from the original sourceforge repo

Comments

@SingingBush
Copy link
Owner

Add the Australia Post barcode generation from the Format control code and Sort code (DPID).
https://sourceforge.net/p/barcode4j/patches/18/
Created: 2009-01-02 by Antun Oreskovic

the zip contained following readme:

Hi Jeremias,

I believe that I have matched the code style, as you request. I took your RoyalBC code,
and converted to Austpost. All my changes were new classes, as I am not sure what the deal
is with changing existing code.

Obviously, I had to change;
org.krysalis.barcode4j.DefaultBarcodeClassResolver

by adding;
registerBarcodeClass("austpost",
"org.krysalis.barcode4j.impl.fourstate.AustPost", true);

Please review and let me know what you think. Any suggestions or changes you want made to it,
go right ahead, or let me know and I will make them.

I had to override some methods in the Fourstate classes, as the bars are reversed in
Austpost, then they are in Fourstate.

Additions;
org.krysalis.barcode4j.impl.fourstate.AustPost
org.krysalis.barcode4j.impl.fourstate.AustPostBean
org.krysalis.barcode4j.impl.fourstate.AustPostLogicImpl
These 3 you should recognise, very similar to RoyalMailCBC.
Just has some override methods for the bar calcs.

org.krysalis.barcode4j.impl.fourstate.FourStateAustPostLogicHandler
This class overrides the addbar, as the bars are reversed.

org.krysalis.barcode4j.impl.fourstate.AbstractAustPostLogicImpl
This class is the one that converts the Australian Format control and Sort code(DPID)
into the bar value representation. It does the Reed solomon calcs.

  • Instructions for Use

To use this in XSL using FOP:

Set up variable,

<xsl:variable name="gbl-auspost-bc">

5.4mm
0.4mm
2.5
2mm
1.4mm
0.7mm

ignore
none

</xsl:variable>

fo:block
fo:instream-foreign-object
<xsl:copy-of select="barcode:generate($gbl-auspost-bc, $barval)"/>
</fo:instream-foreign-object>
</fo:block>

There are three customer barcode structures;
the inclusion of customer information being allowed in two bar types:

  • Standard Customer Barcode 1 - length 37 bars, no bars of customer information
  • Customer Barcode 2 - length 52 bars, 16 bars of customer information
  • Customer Barcode 3 - length 67 bars, 31 bars of customer information

The $barval needs to be a concatenation of FFC and DPID.

FFC:

  • Under Barcode 1 are;
    11 = Standard Customer Barcode
    45 = Reply Paid Barcode
    92 = Redirection Barcode

  • Under Barcode 2 is;
    59 = Customer Barcode 2

  • Under Barcode 3 are;
    62 = Customer Barcode 3
    44 = Currently Reserved

DPID:

  • This is a unique 8A value of each address, supplied by Australia Post.
    Example: 39549554

Therefore, is you want a Standard Barcode 1, $Barval would be;
1139549554

This will return a blank value if DPID could not be converted.

@SingingBush SingingBush added the svn patch A patch from the original sourceforge repo label Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
svn patch A patch from the original sourceforge repo
Projects
None yet
Development

No branches or pull requests

1 participant