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.
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.
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: