#31139 - 07/07/10 04:30 PM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
I'm using the barcode object.
The extra lines might not be a problem (it still reads the same barcode number) if I could put some bar width reduction on... but that feature doesn't exist.
I was wondering if anything could be done with press talk....
I've tried the font route but have had trouble loading the font I've got - but i've not really spent much time on the font method yet as
a) I don't want to use fonts if I can help it b) I wont be able to do bar width reduction on the font method either.
All ideas welcome as apart from the barcode issue the software is working very well for us.
|
Top
|
|
|
|
#31140 - 07/07/10 04:58 PM
Re: Code 128 barcode not using recomended encoding
|
Anonymous
Unregistered
|
Hello Danny,
Our barcode object does follow the standards as defined for 128. However, 128 comes in 3 different subsets and if you are comparing the barcode itself to another one, it is possible that the other barcode is using a different subset (or even changes subset which is possible).
If you just want to play with the dimensions of the barcode there are 2 different ways to do so. You can play with the mils (the bar widths) that will play with the width of the barcode.
Another possibility is to use a scale in PressTalk before the object.
scale(0.5,0,5) would show your barcode "half sized". You can play with those numbers and make the barcode more or less any size that you want.
On a side note, if the barcode is showing only numbers, you might want to try subset C which is used for numerical data.
|
Top
|
|
|
|
#31141 - 07/07/10 04:59 PM
Re: Code 128 barcode not using recomended encoding
|
Anonymous
Unregistered
|
Danny,
On your first post you say that PP does not use the recomended encoding for a code 128 barcode. Then you say that there are no bar width reduction option in PlanetPress Suite... I must respectfully disagree with both affirmations, based on my understanding of what is a barcode encoding and what is the barcode width: You can customize both in the barcode object.
I would suggest that you take a closer look at the barcode object's properties, specially those on the 'barcode options' tab. For example, have you tried reducing the value of the barcode object's Bar with (in mils.) property?
Hope this helps
Benoit
|
Top
|
|
|
|
#31142 - 07/07/10 05:21 PM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
I've tried all 3 subsets but I am willing to try them again. Am I right in thinking that if I have 15 numbers I will need to prefix the barcode with a 0 to use subset type C? My barcodes are 15 numeric digits. I have a barcode that I generated in another system and it reads a perfect A... but when I compare it to the barcode generated from PP with the exact same number the PP one clearly has more lines. My barcode scanner provides a message and when you check thier help documents it states Case where the error message "Sub Optimal Packing" appears in the structure window when verifying a Code 128 barcode (including GS1-128). This structural error in the code is caused because the recommended method of encoding this data has not been followed and as a result the bar code contains many more bars than it needs to. We call this error 'Sub-optimal packing' and although it does not directly affect the print quality (it may indirectly if the size of the bars has needed to be reduced to encode the extra bars), it is displayed as an error because the data has not been encoded according to the specification in the Code 128 standard From : http://www.axicon.com/guide/module_3.htm I've only been working with this software for 2 days so please forgive me if I'm asking questions that are obvious but does changing the "Bar widths (in mils)" change the width of each bar or just change the with of the barcode as a whole? - it seems to change the whole barcode width. Thanks Danny i'll have a go at the scale methods.
|
Top
|
|
|
|
#31143 - 07/07/10 05:35 PM
Re: Code 128 barcode not using recomended encoding
|
Anonymous
Unregistered
|
Danny, Maybe this example can help. This is an example 'custom data selection' for a barcode 128. The barcode is encoded in subset A, then switches to subset C, then switches back to subset A. ='420'+'^099'+'12345678'+'^101'+'ABC' When in subset A, '^099' indicates to switch to subset C. That will reduce the barcode width for the next 8 digits (12345678). Then '^101' means to switch back to subset A. You can compare the above value with this one, using only subset A in the first example the barcode is shorter because it is using subset C to encode '12345678' Hope this helps! Ben
|
Top
|
|
|
|
#31144 - 07/07/10 06:24 PM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
I'm not a barcode expert (I'm a programming looking at integrating this into our workflow systems) but my understanding of bar width reduction is that the black lines are reduced in width (which in turn actually increases the width of the white space. Then when the barcode is printed the ink is put down and there is spread of ink so the barcode lines fatten up to what they should be. - i'm 99% sure that this is the whole point of bar width reduction.
PP's bar width option changes the entire barcode (including the white spaces).
I'm going to try a combination of the scale() function and increase the bar width - I'm working remotely at the moment so I can not test how the barcodes scan until tomorrow.
|
Top
|
|
|
|
#31145 - 07/08/10 05:40 AM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
Right... to start of with just a thank you for your help so far.
I've scanned the barcode that I had printed from another system and discovered it was a Subset C barcode. and if I add a 0 to my barcode (as a check digit) I can get it to read an A reading... but then my barcode has an extra 0 in.
From what I read a Sub set C requires an even number of digits.
I've then created the barcode on yet nother system and scanned it and they have used subset C for all the characters apart from the last character which is a subset A.
Anyway I've replicated this on the PP software using the method Ben gave me and I get it to read a B.... this is where bar width reduction would come in to do that last bit of tweaking (I should also say that it reads a B on a laser printer but on the digital press that I will be outputting it on I suspect it will read a C or D.
I'll update you on that but can anyone confirm that the bar width reduction on the PP software does not work in the way I described above (which is the way I believe bar width reduction is supposed to work)
Thanks Danny
|
Top
|
|
|
|
#31146 - 07/08/10 05:59 AM
Re: Code 128 barcode not using recomended encoding
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
Danny Your understanding of bar width reduction is correct. The black bars are supposed to be very slightly thiner than the corresponding white bars in order to compensate for ink spreading in printing and to optimise the scanning and decoding process. However, with modern high resolution printers and scanners it is completely unnecessary and this is unlikely to be the cause of your problems. The optimal packing that your error refers to probably means that it is looking for a subset C code, which encodes 2 digits in each character. If you have an odd number of digits then you can switch codes at the end and print the last character as a subset A or subset B. See this post for PPTalk code that switches to Subset B PPTalk for C128 barcode and here is the corresponding code for switching to code A. moveto(0,0)
define(&_DataSel_,string,'')
set(&_DataSel_,&_DataSel_ + '01234567890')
define(&_Y2_,measure,&height)
if(&height < 0)
set(&_Y2_,0)
endif()
define(&BarHeight,measure,&height)
define(&BarWidth,measure,0.0120)
define(&BarType,integer,1)
setfillcolor([0,0,0,100])
showbarcode('\209')
define(&_x_,integer,length(&_DataSel_))
define(&_z_,integer,0)
for(&_z_,1,2,&_x_ - 1)
showbarcode(c128(mid(&_DataSel_,&_z_,2)))
endfor()
if(eq(mod(&_x_,2),1))
showbarcode('\205' + right(&_DataSel_,1))
endif()
define(&_bcTotal_,integer,105)
define(&_check_,integer,0)
define(&_bci_,integer,1)
for(&_z_,1,2,&_x_ - 1)
&_bcTotal_ := &_bcTotal_ + (&_bci_ * (strtoint(mid(&_DataSel_,&_z_,2))))
&_bci_ := &_bci_ + 1
endfor()
if(eq(mod(&_x_,2),1))
&_bcTotal_ := &_bcTotal_ + (&_bci_ * 101) + ((&_bci_ + 1) * (strtoint(right(&_DataSel_,1)) + 16))
endif()
&_check_ := mod(&_bcTotal_, 103)
showbarcode(char(&_check_ + 32))
showbarcode('\212')
&width := ¤t.x
moveto(¤t.x / 2.0,&_Y2_+0.16)
showcenter(&_DataSel_) I lifted this code straight out of a PlanetPress Version 5 barcode object. Back in V5 PP did this automatically!. Hope that helps Stuart
|
Top
|
|
|
|
#31147 - 07/08/10 06:46 AM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
Thanks Stuart.
In most cases you might not need to apply Bar Width reduction but we are printing barcodes that are quite small (we are trying to print a code 128 that is 30mm wide).
As we're printing quite a small barcode we've had to apply BWR to get the barcodes to print out and get an A reading on our Litho offset presses and on 3 types of digital (HP indigo, Xerox iGen and a small Oce press).
I tried your code (with my 15 digit barcode in) and at best I get a C, when I use the scale function to scale it down to the size I need.
I'm waiting for the results from the digital print press print outs so I can see what the spread is like on the barcodes... I can get away with a B - but would rather have an A.
|
Top
|
|
|
|
#31148 - 07/08/10 07:27 AM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
I've just scanned the tests we've done from the digital press and we're getting 35% Bar gain which is meaning we're getting a D reading.
Are there no press talk options to thin down each bar?
|
Top
|
|
|
|
#31149 - 07/08/10 07:39 AM
Re: Code 128 barcode not using recomended encoding
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
There is a bar width adjustment for UPC/EAN codes, but reading the specification for C128, I can't find any mention of bar width reduction for these codes. I found the spec here GS1 barcode spec . Do you have a different spec?
|
Top
|
|
|
|
#31150 - 07/08/10 07:55 AM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
Hi Stuart,
The spec is not really relevant as I dont want the actual printed document to have the barwidth reduction on... If we have a bar that is 2mm wide then when I Print it digitally with 35% bar gain it is going to become 2.7mm wide (and eat up some white space)... so if I thin that bar down to 1.48mm when it's printed and it adds the 35% bar gain then it will come out at 2mm wide again and scan correctly.
Danny
|
Top
|
|
|
|
#31151 - 07/08/10 11:05 AM
Re: Code 128 barcode not using recomended encoding
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
I don't understand where your 35% bar gain is coming from. At 600dpi a 2mm bar is about 48 pixels wide and 35% of that is another 16 pixels.
Does it fatten every line, character wtc by 35%? What does it do to images?
I can't see any way of using the PP barcode routines to do what you want. You would need to code your own barcode routine in presstalk.
|
Top
|
|
|
|
#31152 - 07/08/10 11:30 AM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
Hi Stuart,
forgive me but I do not know what your background is so if the below is obvious to you then please dont be offended.
The simplest way to describe it is get a fountain pen and touch it to a bit of paper... the ink will spread slightly.... the same happens when you put wet ink on card... we get some dot gain
Our barcode scanner is reading 35% dot gain... so on average the dots are spreading by 35% when they hit the card.
If this was being manually originated then the user might put a white stroke on it to narrow the black lines to compensate for the ink spread. - most cases we dont do this as we dont always need to get an A/B grade... but this project calls for it.
The dot gain is applied to all the objects but as it's applied evenly then it's not an issue - as it's not measured like a barcode is.
Danny
|
Top
|
|
|
|
#31153 - 07/09/10 08:19 AM
Re: Code 128 barcode not using recomended encoding
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
|
Top
|
|
|
|
#31154 - 07/09/10 10:17 AM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
Stuart.
Thanks for this - you've obviously put lots of work in on it!!
The bar width reduction works perfectly and I can get it down to how I need... but i'm having 2 issues with your code... the decoabailty is failing on 2 of the pairs in the barcode and it's adding extra characters on when it switches to Sub set A - they may be related issues.
If I use barcode 123260789002267 then when I scan it it reads back 12326078900227122 (the 1 part of it reads back in superscript)
If a generate a dimensional analysis report it reads the barcode back as
StartC 12 32 60 78 90 02 27 F1 22 72 Stop
where as a normal barcode reads back as
StartC 12 32 60 78 90 02 27 SubsetA 6 Nul Stop
There seems to be some issue with the check digit.
The 10 digit barcode you provided does not have the same issues.
Thanks for everything so far Danny
|
Top
|
|
|
|
#31155 - 07/12/10 05:35 AM
Re: Code 128 barcode not using recomended encoding
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
Danny Whoops! Well I said I couldn't test it. I used the wrong symbol code - instead of 100 for "switch to subset A" I had 102 which is "function 1". Put that right and I reckon it will be fine. Find the lines %if length is odd, switch to codeA and then put in last character
if(mod(length(&data),2)=1)
% if you prefer CodeB replace 102 by 101
&currsymbol:=102 and replace them by %if length is odd, switch to codeB and then put in last character
if(mod(length(&data),2)=1)
% if you prefer CodeA replace 100 by 101
&currsymbol:=100
I will edit my main post to correct it. regards Stuart
|
Top
|
|
|
|
#31156 - 07/12/10 08:37 AM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
Thanks Stuart,
I actually looked at that bit (which is a good sign that I am starting to understand the code)
The only other issue I had was I had to change
define(&baradjustmult,measure,0.81)
to
define(&baradjustmult,measure,1.0)
It's great to have the option but it was damaging the decodability when used in conjunction with the ability to reduce the lines in mm.
I've only done tests on laser (and not of that many varying numbers) but so far I'm getting nothing but A's... the test on the digital press will be done within the hour. I'll let you know how that goes.
I also need to understand exactly what the code does... I've looked through it and get the basic ideas but if it's ok I would like to post some more specific questions - I might have to do the same to an EAN 13 or a 2 of 5 next time (plus I dont like using code I do not understand).
Once again many thanks... you've really helped me out (and ensured a sale for Objectif Lune)
Danny
|
Top
|
|
|
|
#31157 - 07/13/10 08:06 AM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
Hi Stuart, it's good news and bad news...
The good news is that I can get an A reading out of our digital press when I've applied the bar width reduction.
The bad news is that some barcodes are not generating correctly.
42 seems to be a case where it misses bars.
Here are some barcodes I am testing with
749499172004421 723627096042995
There also seems to be another problem where some barcodes
483808199395947 488986186134918 724823167525583
Then these barcodes are generated from a normal planet press Code 128 (using ='48380819939594'+'^100'+'7' to change the last character) or from our other systems they have an additional set of bars that are marked as "J". In these cases the J is after the check digit but before the stop bars.
The code you gave me does not seem to be putting the J in.
Can you let me know that the Numbers are that you load into the array for each symbol? what do they represent? the dimensions of each bar?
Thanks Danny
|
Top
|
|
|
|
#31158 - 07/13/10 08:57 AM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
forget the 42 issue.... found it... you've declared 42 as 43 (so there are 2 43's.)
This is good though as it has made me start to dig through and understand the code more.
|
Top
|
|
|
|
#31159 - 07/13/10 09:05 AM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
This has also fixed the check sum issue.
|
Top
|
|
|
|
#31160 - 07/13/10 09:14 AM
Re: Code 128 barcode not using recomended encoding
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
|
Top
|
|
|
|
#31161 - 07/14/10 05:04 AM
Re: Code 128 barcode not using recomended encoding
|
OL Newbie
Registered: 07/07/10
Posts: 30
|
Hi Stuart, Everything seems to be working great.
I'm going to have a detailed look at the code and ensure I understand it all
Thanks again Danny
|
Top
|
|
|
|
|
|