 |
|
|
 |
|
 |
Hi,
i'm planning to do a project name library management system in which i hav to use barcodes . . . . . i have to generate barcodes for student details and also for the bookdetails... i'm new to this area of barcodes.can anyone pls tell me which type of barcode to use,which will be suitable and simple for this application... i live in india..
pls help me..
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
The "buzzword" library points to Codabar symbology. As alternatives you may use Code39 or even Code93 symbologies. If students or book details have a significant capacity (more than few bytes), then you may consider using a 2D symbology like DataMatrix. CodeProject has a variety of articles with source code for all the above symbologies.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I recently downloaded your source code and am attempting to compile it using VS2005, C#2.0, .Net2.0. I am getting the error message, "Type expected" at line 46 of OneCode.cs
public static String OneCodeBars(this String source) {
Please correct this error and repost the solution at your convience.
Thank you and Happy New Year.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Actually there is no error. You probably missed the statement "The downloads include one VB.NET and one C# class – VS2008 with .NET 3.5 syntax - that generate..." The error message is generated because of the var keyword (implicitly typed local variables) that is available only in C# 3.0.
In order to compile with C# 2.0 and VS2005 replace all vars with explicit types.
For example loops with integers will be:
for (Int32 i = 0... instead of:
for (var i = 0...
Happy new year
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
One needs to get the USPS encoder and font for generating the Intelligent Mail Barcode. Go to: http://ribbs.usps.gov/onecodesolution/ Request your username and password from usps. You should get it in a day.
Download: uspsEncoderMsWindows32-1.2.0.zip, USPS4CBFONTS.zip from the URL above. Unzip and copy the encoder (uspsEncoderMsWindows32-1.2.0\modules\c\usps4cb.dll) to the Windows directory. Copy the font (USPS4CBFONTS\nonAfpFontsv1r2m0\fonts\truetype) to the Windows\Fonts directory. User guide is under the directory - uspsEncoderMsWindows32-1.2.0\userGuide\. Do the following to your .Net project.
Step 1: Use the USPS published encoder (Windows C dll) to encode the barcode string. //Definition [DllImport("usps4cb.dll", EntryPoint = "USPS4CB")] public static extern int USPS4CB( [MarshalAs(UnmanagedType.LPStr)] String TrackString, [MarshalAs(UnmanagedType.LPStr)] String RouteString, [MarshalAs(UnmanagedType.LPStr)] StringBuilder buf); //declare variable to hold the encoded bar string StringBuilder BarString = new StringBuilder(65); //keep to 65 since encoder returns //65 specific characters //Sample Function Call int RetCode = USPS4CB("01234567094987654321", "01234", BarString);
Step 2: Use the encoded string (BarString) from above to display the barcode using the font USPS4CB.
This way we can get both the return code and the encoded string. Happy Intelligent Mail Barcode programming.
Lakshmi Narayanan Software Developer
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
Hello All!
Let me start off by thanking drdigit for all of his hard work. It truly is a quality application.
However, there is a bug or two in the decoder. I have tried both the C# and VB versions, with the same result. The string that causes the problem is...
Encode: "72 777 777777 777777777 77777777777" -> FFDTADTDAFTATDTTDDTFDTAAFAFDDTATTFTTAAAFFDFATATTAFTDFATDDDFTFFFDD
Decode: "FFDTADTDAFTATDTTDDTFDTAAFAFDDTATTFTTAAAFFDFATATTAFTDFATDDDFTFFFDD" -> "17 777 777777 777777777 77777777777"
...but I would imagine the error would occur if the numbers were different. So far in testing, I am told the first digit cannot be over 4, otherwise an overflow occurs.
Please look into this drdigit as I will be releasing a converted PHP version in the coming weeks. At this point, it functions exactly like both the C# and VB versions (and returns the same overflow error).
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I found some errors in the decode as well and was able to correct the error with a few lines of code.
And a few other small modifications.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Could you please post the few lines of code you changed?
When I decode:
FTTFTADTFATTDDDTDTDTTDDDDDDTADDFFTAADDTFATDFTTAADTAFDDFAAFFTADDFA
the USPS results are: 00700123456123456792605211234 but this decoder gives: 15814079586565956792604312759
which is obviously incorrect.
Thanks - Gylfi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
One of the most important problems that I found was in the following code. Additions are remarked with my initials. 'bgh I discovered that examples like the one you provided (FTTFTADTFATTDDDTDTDTTDDDDDDTADDFFTAADDTFATDFTTAADTAFDDFAAFFTADDFA) that would result in a -1 index value in the table 5of13 and in the table2of13, my code does a 3rd test of index <0 and sets test = not test and 8191 then rechecks the table2of13 For i = 0 To 9 Dim test = ad(i), index = Array.IndexOf(table5of13, test) If (index < 0) Then test = Not test And 8191 index = Array.IndexOf(table5of13, test) If (index < 0) Then test = ad(i) 'bgh index = Array.IndexOf(table2of13, test) If (index < 0) Then ' bgh test = Not test And 8191 'bgh index = Array.IndexOf(table2of13, test) 'bgh End If 'bgh index += 1287 End If End If ad(i) = index Next
In the next section I made these changes. 'original code start For i = 2 To 19 OneCodeMathAdd(byteArray, 13, -r) OneCodeMathDivide(byteArray, 10) r = OneCodeMathMod(byteArray, 10) result = r.ToString() & result Next OneCodeMathAdd(byteArray, 13, -r) OneCodeMathDivide(byteArray, 5) r = OneCodeMathMod(byteArray, 5) result = r.ToString() & result OneCodeMathAdd(byteArray, 13, -r) OneCodeMathDivide(byteArray, 10) 'original code end
' my code start For i = 2 To 18 'bgh only loop 2 to 18 because the 19th test should be mod 5 OneCodeMathAdd(byteArray, 13, -r) OneCodeMathDivide(byteArray, 10) r = OneCodeMathMod(byteArray, 10) result = r.ToString() & result Next
OneCodeMathAdd(byteArray, 13, -r)'bgh OneCodeMathDivide(byteArray, 10) 'bgh r = OneCodeMathMod(byteArray, 5) 'bgh 19 divide by 10 is then mod 5 result = r.ToString() & result 'bgh OneCodeMathAdd(byteArray, 13, -r) 'bgh OneCodeMathDivide(byteArray, 5) ' bgh now divide by 5 and mod 10 r = OneCodeMathMod(byteArray, 10) 'bgh result = r.ToString() & result ' bgh last result OneCodeMathAdd(byteArray, 13, -r)' bgh OneCodeMathDivide(byteArray, 10) 'one last divide by 10 'my code end
Those are the changes that I made to get the correct results that match the postal decoder. my version of the decoder result = 00700123456123456792605211234
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Was not sure how to post the code, so I hope it appears correctly in the previous message, found that html was botching some of my response so I reposted with corrections.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I wanted to make another comment about the first for next loop.
If at any time (index = -1) prior to the (index +=1287) it is a very good indication that the barcode being decoded is invalid.
If a value of -1 reaches that line of code the code will continue with a decode result, but the result really should be invalid.
If the index is still -1 with the code changes I made, then the test was not found in the table.
To test this, type in a random series of ATFD letters, and use the decode routine. There will be a result, but it would likely fail on the Postal decoder.
The correct place to test for an invalid code would be a result of -1 at this section...
If (index < 0) Then ' bgh test = Not test And 8191 'bgh index = Array.IndexOf(table2of13, test) 'bgh End If 'bgh insert if index = -1 then message box invalid code etc.... endif index += 1287
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks a lot for posting these fixes - this is very helpful.
I inted to take the mailText.txt file that the USPS provides and run that through both the USPS decoder and this one and compare the results. If all of those barcodes yield the same results, then we're probably in good shape. I'll let you know.
Thanks again - Gylfi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Please let me know the results and where do I get this mailText.txt?
Gylfi Ingvason wrote: I inted to take the mailText.txt file that the USPS provides and run that through both the USPS decoder and this one and compare the results.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
The mailText.txt is available at the USPS IMB download site at:
https://ribbs.usps.gov/index.cfm?page=intellmailmailpieces
The file contains 1257 addresses and associated IMB barcodes that are broken down into into components for testing. After applying your fixes posted earlier, the decoding of all these barcodes match the results of the USPS decode web site. Nice job!
You have to sign up for a user-id/password to access the USPS site, and it took them a few weeks to issue mine if I remember correctly. It seems absurd that they don't just make this stuff public, but it's the government we're talking about, so who knows what the thinking is.
If you are interested, send me a private e-mail to
gylfi@computer.org
and I'll e-mail you the file. I don't think I'll be breaking any laws in doing so, but like I said, all of them match now. Thanks a bunch for taking the time to debug this - it surely is appreciated.
Best regards,
Gylfi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
I used your class to verify my C# implementation (didn't find yours in time to just use it). Anyway, when I ran 11,000 unique addresses through both of our encoding routines I found three that failed to match from your implementation to mine. Using the USPS encoder (http://ribbs.usps.gov/OneCodeSolution/Barcode_Encoder.Aspx) I found one of them was due to a bug in the BigInteger class I used within my implementation. I did not take time to find why your VB implementation did not match the USPS results for the other two missmatches. FYI-Here are the two test cases that may have an issue:
1) Tracking#: 00 700 888888 010159052 PostNet: 57325052828
USPS: TDTDF FADFT AFFDF ADTAD DDATF AATFT DDDAD FDTFT FDFFT FFFAD AFFDA DADDA FDDDD vb: TDDTT DAFDD FAADA TDATF DTDTA ATFFD ADFAF TDDAT FFTDT DTAAD FFDTF TATTT FDFFA
2) Tracking#: 00 700 905016001 174945 PostNet: 57325052828
USPS: TAFTT TDFAF DTTTA DAFFF FADDF FATDF TADFA DDFTF AAFTF FTTTF FTFAA ADTTD FAADA vb: ATTDT FTTAF TAFTT DTDDA FATTT FAFAD AAFTF TTATT TADFF ADDAF TFDAA FFFTD AFDFA
Thank You-Very Much! brian
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thank you for sharing the results of your test cases. They helped me solve the problem (the update is already emailed for upload). During the debugging process I used the USPS online tools. According to USPS, encoded information is unique, meaning that decoding generates unique information for any given group of bars. By using the errors you tracked I found that the official decoder (http://ribbs.usps.gov/OneCodeSolution/Barcode_Decoder.Aspx) generates exactly the same initial information for different groups of bars. The pairs I used are as follows:
Bars 1: TDDTTDAFDDFAADATDATFDTDTAATFFDADFAFTDDATFFTDTDTAADFFDTFTATTTFDFFA Bars 2: TDTDFFADFTAFFDFADTADDDATFAATFTDDDADFDTFTFDFFTFFFADAFFDADADDAFDDDD Common Result: 00 700 888888 010159052 57325052828
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
How Hard would this be to convert to PHP?
It would be sweet to be able to use this with web applications!
***edit***
I have been doing my best to translate to PHP, but I do need a little more help in order to release this script and help others... Please help me anyone! Please help Dr Digit. I am sure you know how hard that specification pack is to follow 
I will be forever grateful to whoever helps me help others with this port!
Just let me know an email to send the code to! (about 300 lines)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
This code works grat thanks, it was exactly what I was looking for. USPS does ship their thing with compiled dlls and a cryptic c++ code.
thanks!
hp 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
You have done a great job getting through the USPS jibberish to come up with this code. My question is do you have code for a Decoder? The USPS states that they can't supply any code (a decoder is on their web site) just sudo code.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Hopefully I'll find the time needed to write the decoder code within this weekend. Please check for an update next week.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
Finally I found the time to write the routine and submit it for update.
It's ???, but after all these months there is no other decoder implementation with source code on the net!!!
|
| Sign In·View Thread·PermaLink | 4.20/5 (5 votes) |
|
|
|
 |