drawing a Barcode without a Barcode font

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
Hi,

at the moment i am using a special barcode font “2of5interleaved” to draw/create a Code25/2of5interleaved  barcode.
The code itself is calcualted by script and then displayed using that barcode font

The font only has 4 characters  2 black bars (1one them is twice the width of the other) and 2 blank bars(also 1 twice the width of the other)
When printed, the smaller bars should have a width of at least  0,5mm  and the wider one at least 1mm.

How would i create the bars? Should i use vertical lines or SVGs?
Did anyone have done something similar already?

Regards,
Matthias
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
Hi.

Curious.

So you are creating your own barcode, er, code? That is, you are, say,
making three thin lines with thin spaces, and then three thick lines with
thick spaces, and storing that pattern somewhere?

And then you read that pattern and look up what it refers to?

Craig



--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
Currently i am using a special 2of5i barcode font. The font .has only four characters (bars) in its set.
The code displays a
narrow space (blank) bar when the character is n
narrow black bar when N
wide space when w
wide black bar when W

The code can only display a pair number of digits. You cannot display a number with 23 digits.
So to display the number  590848500010000294926452
i have to enter the followingNnNnWnNwWnNwNnNwNnWnWwNnNwNnWnNwWnWnNnWwNwNnNnNnWwWwNnWnNnNwNwWnNnNnWwWwNnNnNwWnWnNwNnWnNwWnNwNnWwNnWnNwNnWnWwNnNwWnNwWnNnNwWnN
into the field.  There is a special algorithm how to calculate the correct combination of the different bars, but that is not my problem.

 What i want is to draw the code myself without using the  font.  So that´s why i asked if someone already has done this.

Btw: the code for calculation the code looks like this, i case someone is interested

function createBarcode tBarcode

if the number of chars of tBarcode is not 24

then

answer error "Fehler beim Erzeugen des Barcodes"

exit to top

end if

put "NNWWN" into t0

put "WNNNW" into t1

put "NWNNW" into t2

put "WWNNN" into t3

put "NNWNW" into t4

put "WNWNN" into t5

put "NWWNN" into t6

put "NNNWW" into t7

put "WNNWN" into t8

put "NWNWN" into t9

put "" into tNewBarcode

repeat with i = 1 to 23 step 2

put char i to (i+1) of tBarcode into tPair

replace 1 with t1 in tPair

replace 2 with t2 in tPair

replace 3 with t3 in tPAir

replace 4 with t4 in tPair

replace 5 with t5 in tPair

replace 6 with t6 in tPair

replace 7 with t7 in tPair

replace 8 with t8 in tPair

replace 9 with t9 in tPair

replace 0 with t0 in tPair

put char 1 to 5 of tPair & toLower(char 6 to 10 of tPAir) into tPair

put "" into tNewPAir

repeat with j = 1 to 5

put char j of tPair &char j+5 of tPair after tNewPair

end repeat

put tnewPair after tNewBarcode

end repeat

return tNewBarcode
end createBarcode


Regards,

Matthias


> Am 19.07.2018 um 22:30 schrieb dunbarxx via use-livecode <[hidden email]>:
>
> Hi.
>
> Curious.
>
> So you are creating your own barcode, er, code? That is, you are, say,
> making three thin lines with thin spaces, and then three thick lines with
> thick spaces, and storing that pattern somewhere?
>
> And then you read that pattern and look up what it refers to?
>
> Craig
>
>
>
> --
> Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
I think the trick will be drawing large graphics one at a time and properly spaced at several times their finished size, perhaps off screen, then getting a snapshot of the result and scaling it down. Not sure how picky the readers will be.

Bob S


> On Jul 19, 2018, at 15:06 , Matthias Rebbe via use-livecode <[hidden email]> wrote:
>
> Currently i am using a special 2of5i barcode font. The font .has only four characters (bars) in its set.
> The code displays a
> narrow space (blank) bar when the character is n
> narrow black bar when N
> wide space when w
> wide black bar when W


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
Not sure if it will work for your purpose, but as a test I created for
graphic lines, 1 narrow black, 1 wider black, duplicated them and set the
blendlevel of the copies so that they're transparent.

Grcs are named narrowB, wideB, narrowC and wideC (b for black, c for clear)

Then used the following code (and your example string from above with the
WWnNw stuff) to generate a barcode.

on mouseup
   put empty into tLast
   put field 1 into tChars -- the field with your wNnnW string
   set the casesensitive to true -- to differentiate case of course
   repeat for each char tChar in tChars
      switch tChar
         case "N" -- checks the char, and clones the matching bar.
                        --if its the first time through, places it at a
start location
                        -- then uses the id of the most recent bar for
placement purposes
            clone grc "narrowB"
            if tLast is empty then
               set the topleft of the last grc to 10,50
            else
               set the topleft of the last grc to the topright of grc id
tLast
            end if
            break
         case "n"
            clone grc "narrowC"
            if tLast is empty then
               set the topleft of the last grc to 10,50
            else
               set the topleft of the last grc to the topright of grc id
tLast
            end if
            break
         case "W"
            clone grc "wideB"
            if tLast is empty then
               set the topleft of the last grc to 10,50
            else
               set the topleft of the last grc to the topright of grc id
tLast
            end if
            break
         case "w"
            clone grc "widec"
            if tLast is empty then
               set the topleft of the last grc to 10,50
            else
               set the topleft of the last grc to the topright of grc id
tLast
            end if
            break

      end switch
      put the short id of the last grc into tLast -- the id of the most
recently placed bar
   end repeat
end mouseup

Spacing and line size might need to be tweaked, but it seems like this
would be relatively straight forward.

On Thu, Jul 19, 2018 at 4:30 PM Bob Sneidar via use-livecode <
[hidden email]> wrote:

> I think the trick will be drawing large graphics one at a time and
> properly spaced at several times their finished size, perhaps off screen,
> then getting a snapshot of the result and scaling it down. Not sure how
> picky the readers will be.
>
> Bob S
>
>
> > On Jul 19, 2018, at 15:06 , Matthias Rebbe via use-livecode <
> [hidden email]> wrote:
> >
> > Currently i am using a special 2of5i barcode font. The font .has only
> four characters (bars) in its set.
> > The code displays a
> > narrow space (blank) bar when the character is n
> > narrow black bar when N
> > wide space when w
> > wide black bar when W
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
Mike

you´re awesome. That is already an almost complete solution to my question. Never had expected that. Thank you very much.
I´ve made some little changes. One among of them is:
To have all the separate bars of the barcode in a group, i changed the lines where the grc is cloned
to for example        copy grc “narrowB” to grp “barcode2of5”

Here´s now my code to convert the nNnNN…. string to Barcode

local tLast
on mouseup
   if there is a grp "barcode2of5" then delete grp "barcode2of5"
   -- now change the width of the template graphics
   put "2" into tNarrow
   put "4" into tWide
   set the width of grc "narrowC" to tNarrow
   set the width of grc "narrowB" to tNarrow
   set the width of grc "wideC" to tWide
   set the width of grc "wideB" to tWide
   put "0" into tHorAdjust -- allows to put a gap beween the separate bars.
   put "60,286" into tBarTopLeft -- defines where the first bar is placed
   put empty into tLast
   put fld "2of5" into tChars -- the field with your wNnnW string
   set the casesensitive to true -- to differentiate case of course
   create grp "barcode2of5"
   repeat for each char tChar in tChars
      switch tChar
         case "N"
            -- checks the char, and clones the matching bar.
            --if its the first time through, places it at astart location
            -- then uses the id of the most recent bar forplacement purposes
            --clone grc "narrowB"
            copy grc "narrowB" to grp "barcode2of5"
            if tLast is empty then
               set the topleft of the last grc to tBarTopLeft
            else
               set the topleft of the last grc to horAdjust(tHorAdjust)
            end if
            break
         case "n"
            --clone grc "narrowC"
            copy grc "narrowC" to grp "barcode2of5"
            if tLast is empty then
               set the topleft of the last grc to tBarTopLeft
            else
               set the topleft of the last grc to horAdjust(tHorAdjust)
            end if
            break
         case "W"
            --clone grc "wideB"
            copy grc "wideB" to grp "barcode2of5"
            if tLast is empty then
               set the topleft of the last grc to tBarTopLeft
            else
               set the topleft of the last grc to horAdjust(tHorAdjust)
            end if
            break
         case "w"
            --clone grc "widec"
            copy grc "widec" to grp "barcode2of5"
            if tLast is empty then
               set the topleft of the last grc to tBarTopLeft
            else
               set the topleft of the last grc to horAdjust(tHorAdjust)
            end if
            break
      end switch
      put the short id of the last grc into tLast -- the id of the most recently placed bar
   end repeat
   set the height of grp "barcode2of5" to 69
   set the width of grp "barcode2of5" to 360  
end mouseup

--This function allows a horizontal adjustment of the single bars.
function horAdjust tHorAdjust
   put the topright of grc id tLast into tTMP
   set the itemdelimiter to ","
   add tHorAdjust to item 1 of tTMP
   return tTMP
end horAdjust

Again, thank you very much for your help.

Regards,

Matthias


> Am 20.07.2018 um 01:01 schrieb Mike Bonner via use-livecode <[hidden email]>:
>
> Not sure if it will work for your purpose, but as a test I created for
> graphic lines, 1 narrow black, 1 wider black, duplicated them and set the
> blendlevel of the copies so that they're transparent.
>
> Grcs are named narrowB, wideB, narrowC and wideC (b for black, c for clear)
>
> Then used the following code (and your example string from above with the
> WWnNw stuff) to generate a barcode.
>
> on mouseup
>   put empty into tLast
>   put field 1 into tChars -- the field with your wNnnW string
>   set the casesensitive to true -- to differentiate case of course
>   repeat for each char tChar in tChars
>      switch tChar
>         case "N" -- checks the char, and clones the matching bar.
>                        --if its the first time through, places it at a
> start location
>                        -- then uses the id of the most recent bar for
> placement purposes
>            clone grc "narrowB"
>            if tLast is empty then
>               set the topleft of the last grc to 10,50
>            else
>               set the topleft of the last grc to the topright of grc id
> tLast
>            end if
>            break
>         case "n"
>            clone grc "narrowC"
>            if tLast is empty then
>               set the topleft of the last grc to 10,50
>            else
>               set the topleft of the last grc to the topright of grc id
> tLast
>            end if
>            break
>         case "W"
>            clone grc "wideB"
>            if tLast is empty then
>               set the topleft of the last grc to 10,50
>            else
>               set the topleft of the last grc to the topright of grc id
> tLast
>            end if
>            break
>         case "w"
>            clone grc "widec"
>            if tLast is empty then
>               set the topleft of the last grc to 10,50
>            else
>               set the topleft of the last grc to the topright of grc id
> tLast
>            end if
>            break
>
>      end switch
>      put the short id of the last grc into tLast -- the id of the most
> recently placed bar
>   end repeat
> end mouseup
>
> Spacing and line size might need to be tweaked, but it seems like this
> would be relatively straight forward.
>
> On Thu, Jul 19, 2018 at 4:30 PM Bob Sneidar via use-livecode <
> [hidden email]> wrote:
>
>> I think the trick will be drawing large graphics one at a time and
>> properly spaced at several times their finished size, perhaps off screen,
>> then getting a snapshot of the result and scaling it down. Not sure how
>> picky the readers will be.
>>
>> Bob S
>>
>>
>>> On Jul 19, 2018, at 15:06 , Matthias Rebbe via use-livecode <
>> [hidden email]> wrote:
>>>
>>> Currently i am using a special 2of5i barcode font. The font .has only
>> four characters (bars) in its set.
>>> The code displays a
>>> narrow space (blank) bar when the character is n
>>> narrow black bar when N
>>> wide space when w
>>> wide black bar when W
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
Very cool!  Does it actually produce a code that can be scanned?

On Fri, Jul 20, 2018 at 3:25 AM Matthias Rebbe via use-livecode <
[hidden email]> wrote:

> Mike
>
> you´re awesome. That is already an almost complete solution to my
> question. Never had expected that. Thank you very much.
> I´ve made some little changes. One among of them is:
> To have all the separate bars of the barcode in a group, i changed the
> lines where the grc is cloned
> to for example        copy grc “narrowB” to grp “barcode2of5”
>
> Here´s now my code to convert the nNnNN…. string to Barcode
>
> local tLast
> on mouseup
>    if there is a grp "barcode2of5" then delete grp "barcode2of5"
>    -- now change the width of the template graphics
>    put "2" into tNarrow
>    put "4" into tWide
>    set the width of grc "narrowC" to tNarrow
>    set the width of grc "narrowB" to tNarrow
>    set the width of grc "wideC" to tWide
>    set the width of grc "wideB" to tWide
>    put "0" into tHorAdjust -- allows to put a gap beween the separate bars.
>    put "60,286" into tBarTopLeft -- defines where the first bar is placed
>    put empty into tLast
>    put fld "2of5" into tChars -- the field with your wNnnW string
>    set the casesensitive to true -- to differentiate case of course
>    create grp "barcode2of5"
>    repeat for each char tChar in tChars
>       switch tChar
>          case "N"
>             -- checks the char, and clones the matching bar.
>             --if its the first time through, places it at astart location
>             -- then uses the id of the most recent bar forplacement
> purposes
>             --clone grc "narrowB"
>             copy grc "narrowB" to grp "barcode2of5"
>             if tLast is empty then
>                set the topleft of the last grc to tBarTopLeft
>             else
>                set the topleft of the last grc to horAdjust(tHorAdjust)
>             end if
>             break
>          case "n"
>             --clone grc "narrowC"
>             copy grc "narrowC" to grp "barcode2of5"
>             if tLast is empty then
>                set the topleft of the last grc to tBarTopLeft
>             else
>                set the topleft of the last grc to horAdjust(tHorAdjust)
>             end if
>             break
>          case "W"
>             --clone grc "wideB"
>             copy grc "wideB" to grp "barcode2of5"
>             if tLast is empty then
>                set the topleft of the last grc to tBarTopLeft
>             else
>                set the topleft of the last grc to horAdjust(tHorAdjust)
>             end if
>             break
>          case "w"
>             --clone grc "widec"
>             copy grc "widec" to grp "barcode2of5"
>             if tLast is empty then
>                set the topleft of the last grc to tBarTopLeft
>             else
>                set the topleft of the last grc to horAdjust(tHorAdjust)
>             end if
>             break
>       end switch
>       put the short id of the last grc into tLast -- the id of the most
> recently placed bar
>    end repeat
>    set the height of grp "barcode2of5" to 69
>    set the width of grp "barcode2of5" to 360
> end mouseup
>
> --This function allows a horizontal adjustment of the single bars.
> function horAdjust tHorAdjust
>    put the topright of grc id tLast into tTMP
>    set the itemdelimiter to ","
>    add tHorAdjust to item 1 of tTMP
>    return tTMP
> end horAdjust
>
> Again, thank you very much for your help.
>
> Regards,
>
> Matthias
>
>
> > Am 20.07.2018 um 01:01 schrieb Mike Bonner via use-livecode <
> [hidden email]>:
> >
> > Not sure if it will work for your purpose, but as a test I created for
> > graphic lines, 1 narrow black, 1 wider black, duplicated them and set the
> > blendlevel of the copies so that they're transparent.
> >
> > Grcs are named narrowB, wideB, narrowC and wideC (b for black, c for
> clear)
> >
> > Then used the following code (and your example string from above with the
> > WWnNw stuff) to generate a barcode.
> >
> > on mouseup
> >   put empty into tLast
> >   put field 1 into tChars -- the field with your wNnnW string
> >   set the casesensitive to true -- to differentiate case of course
> >   repeat for each char tChar in tChars
> >      switch tChar
> >         case "N" -- checks the char, and clones the matching bar.
> >                        --if its the first time through, places it at a
> > start location
> >                        -- then uses the id of the most recent bar for
> > placement purposes
> >            clone grc "narrowB"
> >            if tLast is empty then
> >               set the topleft of the last grc to 10,50
> >            else
> >               set the topleft of the last grc to the topright of grc id
> > tLast
> >            end if
> >            break
> >         case "n"
> >            clone grc "narrowC"
> >            if tLast is empty then
> >               set the topleft of the last grc to 10,50
> >            else
> >               set the topleft of the last grc to the topright of grc id
> > tLast
> >            end if
> >            break
> >         case "W"
> >            clone grc "wideB"
> >            if tLast is empty then
> >               set the topleft of the last grc to 10,50
> >            else
> >               set the topleft of the last grc to the topright of grc id
> > tLast
> >            end if
> >            break
> >         case "w"
> >            clone grc "widec"
> >            if tLast is empty then
> >               set the topleft of the last grc to 10,50
> >            else
> >               set the topleft of the last grc to the topright of grc id
> > tLast
> >            end if
> >            break
> >
> >      end switch
> >      put the short id of the last grc into tLast -- the id of the most
> > recently placed bar
> >   end repeat
> > end mouseup
> >
> > Spacing and line size might need to be tweaked, but it seems like this
> > would be relatively straight forward.
> >
> > On Thu, Jul 19, 2018 at 4:30 PM Bob Sneidar via use-livecode <
> > [hidden email]> wrote:
> >
> >> I think the trick will be drawing large graphics one at a time and
> >> properly spaced at several times their finished size, perhaps off
> screen,
> >> then getting a snapshot of the result and scaling it down. Not sure how
> >> picky the readers will be.
> >>
> >> Bob S
> >>
> >>
> >>> On Jul 19, 2018, at 15:06 , Matthias Rebbe via use-livecode <
> >> [hidden email]> wrote:
> >>>
> >>> Currently i am using a special 2of5i barcode font. The font .has only
> >> four characters (bars) in its set.
> >>> The code displays a
> >>> narrow space (blank) bar when the character is n
> >>> narrow black bar when N
> >>> wide space when w
> >>> wide black bar when W
> >>
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> [hidden email]
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
We tried here with iPhone and also with an USB scanner. Both devices scanned the code successfully.

I have just finished a program for shipment. It fetches customer and invoice data from the accounting software and creates then the shipment labels including a Code25i barcode and a QR code. The carrier is Trans-o-Flex. I need to send some sample labels to their IT department. They will check if the labels are readable by their scanners. But i am now confident, that this will work on their side also.

Thanks again.

Matthias



> Am 20.07.2018 um 11:31 schrieb Mike Bonner via use-livecode <[hidden email]>:
>
> Very cool!  Does it actually produce a code that can be scanned?
>
> On Fri, Jul 20, 2018 at 3:25 AM Matthias Rebbe via use-livecode <
> [hidden email]> wrote:
>
>> Mike
>>
>> you´re awesome. That is already an almost complete solution to my
>> question. Never had expected that. Thank you very much.
>> I´ve made some little changes. One among of them is:
>> To have all the separate bars of the barcode in a group, i changed the
>> lines where the grc is cloned
>> to for example        copy grc “narrowB” to grp “barcode2of5”
>>
>> Here´s now my code to convert the nNnNN…. string to Barcode
>>
>> local tLast
>> on mouseup
>>   if there is a grp "barcode2of5" then delete grp "barcode2of5"
>>   -- now change the width of the template graphics
>>   put "2" into tNarrow
>>   put "4" into tWide
>>   set the width of grc "narrowC" to tNarrow
>>   set the width of grc "narrowB" to tNarrow
>>   set the width of grc "wideC" to tWide
>>   set the width of grc "wideB" to tWide
>>   put "0" into tHorAdjust -- allows to put a gap beween the separate bars.
>>   put "60,286" into tBarTopLeft -- defines where the first bar is placed
>>   put empty into tLast
>>   put fld "2of5" into tChars -- the field with your wNnnW string
>>   set the casesensitive to true -- to differentiate case of course
>>   create grp "barcode2of5"
>>   repeat for each char tChar in tChars
>>      switch tChar
>>         case "N"
>>            -- checks the char, and clones the matching bar.
>>            --if its the first time through, places it at astart location
>>            -- then uses the id of the most recent bar forplacement
>> purposes
>>            --clone grc "narrowB"
>>            copy grc "narrowB" to grp "barcode2of5"
>>            if tLast is empty then
>>               set the topleft of the last grc to tBarTopLeft
>>            else
>>               set the topleft of the last grc to horAdjust(tHorAdjust)
>>            end if
>>            break
>>         case "n"
>>            --clone grc "narrowC"
>>            copy grc "narrowC" to grp "barcode2of5"
>>            if tLast is empty then
>>               set the topleft of the last grc to tBarTopLeft
>>            else
>>               set the topleft of the last grc to horAdjust(tHorAdjust)
>>            end if
>>            break
>>         case "W"
>>            --clone grc "wideB"
>>            copy grc "wideB" to grp "barcode2of5"
>>            if tLast is empty then
>>               set the topleft of the last grc to tBarTopLeft
>>            else
>>               set the topleft of the last grc to horAdjust(tHorAdjust)
>>            end if
>>            break
>>         case "w"
>>            --clone grc "widec"
>>            copy grc "widec" to grp "barcode2of5"
>>            if tLast is empty then
>>               set the topleft of the last grc to tBarTopLeft
>>            else
>>               set the topleft of the last grc to horAdjust(tHorAdjust)
>>            end if
>>            break
>>      end switch
>>      put the short id of the last grc into tLast -- the id of the most
>> recently placed bar
>>   end repeat
>>   set the height of grp "barcode2of5" to 69
>>   set the width of grp "barcode2of5" to 360
>> end mouseup
>>
>> --This function allows a horizontal adjustment of the single bars.
>> function horAdjust tHorAdjust
>>   put the topright of grc id tLast into tTMP
>>   set the itemdelimiter to ","
>>   add tHorAdjust to item 1 of tTMP
>>   return tTMP
>> end horAdjust
>>
>> Again, thank you very much for your help.
>>
>> Regards,
>>
>> Matthias
>>
>>
>>> Am 20.07.2018 um 01:01 schrieb Mike Bonner via use-livecode <
>> [hidden email]>:
>>>
>>> Not sure if it will work for your purpose, but as a test I created for
>>> graphic lines, 1 narrow black, 1 wider black, duplicated them and set the
>>> blendlevel of the copies so that they're transparent.
>>>
>>> Grcs are named narrowB, wideB, narrowC and wideC (b for black, c for
>> clear)
>>>
>>> Then used the following code (and your example string from above with the
>>> WWnNw stuff) to generate a barcode.
>>>
>>> on mouseup
>>>  put empty into tLast
>>>  put field 1 into tChars -- the field with your wNnnW string
>>>  set the casesensitive to true -- to differentiate case of course
>>>  repeat for each char tChar in tChars
>>>     switch tChar
>>>        case "N" -- checks the char, and clones the matching bar.
>>>                       --if its the first time through, places it at a
>>> start location
>>>                       -- then uses the id of the most recent bar for
>>> placement purposes
>>>           clone grc "narrowB"
>>>           if tLast is empty then
>>>              set the topleft of the last grc to 10,50
>>>           else
>>>              set the topleft of the last grc to the topright of grc id
>>> tLast
>>>           end if
>>>           break
>>>        case "n"
>>>           clone grc "narrowC"
>>>           if tLast is empty then
>>>              set the topleft of the last grc to 10,50
>>>           else
>>>              set the topleft of the last grc to the topright of grc id
>>> tLast
>>>           end if
>>>           break
>>>        case "W"
>>>           clone grc "wideB"
>>>           if tLast is empty then
>>>              set the topleft of the last grc to 10,50
>>>           else
>>>              set the topleft of the last grc to the topright of grc id
>>> tLast
>>>           end if
>>>           break
>>>        case "w"
>>>           clone grc "widec"
>>>           if tLast is empty then
>>>              set the topleft of the last grc to 10,50
>>>           else
>>>              set the topleft of the last grc to the topright of grc id
>>> tLast
>>>           end if
>>>           break
>>>
>>>     end switch
>>>     put the short id of the last grc into tLast -- the id of the most
>>> recently placed bar
>>>  end repeat
>>> end mouseup
>>>
>>> Spacing and line size might need to be tweaked, but it seems like this
>>> would be relatively straight forward.
>>>
>>> On Thu, Jul 19, 2018 at 4:30 PM Bob Sneidar via use-livecode <
>>> [hidden email]> wrote:
>>>
>>>> I think the trick will be drawing large graphics one at a time and
>>>> properly spaced at several times their finished size, perhaps off
>> screen,
>>>> then getting a snapshot of the result and scaling it down. Not sure how
>>>> picky the readers will be.
>>>>
>>>> Bob S
>>>>
>>>>
>>>>> On Jul 19, 2018, at 15:06 , Matthias Rebbe via use-livecode <
>>>> [hidden email]> wrote:
>>>>>
>>>>> Currently i am using a special 2of5i barcode font. The font .has only
>>>> four characters (bars) in its set.
>>>>> The code displays a
>>>>> narrow space (blank) bar when the character is n
>>>>> narrow black bar when N
>>>>> wide space when w
>>>>> wide black bar when W
>>>>
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
On 07/20/2018 04:31 AM, Matthias Rebbe via use-livecode wrote:
> We tried here with iPhone and also with an USB scanner. Both devices scanned the code successfully.
>
> I have just finished a program for shipment. It fetches customer and invoice data from the accounting software and creates then the shipment labels including a Code25i barcode and a QR code. The carrier is Trans-o-Flex. I need to send some sample labels to their IT department. They will check if the labels are readable by their scanners. But i am now confident, that this will work on their side also.

Cool. I played around with Mattias' version of Mike's excellent code a
bit. Here's my take. Note that you really only need one graphic image to
work with - here's how to do it with a single invisible filled rectangle
graphic (I kept the name "narrowB"). This takes a string of numbers and
generates the intermediate string and bar code.

-- 2of5 barcode

constant kBarCodeHeight = 69
constant kBarCodeWidth = 360
constant kInitialTopLeft = "60,286" -- defines where the first bar is placed
constant kGapBetweenBars = 0
constant kBarCodeGroupName = "barcode2of5"

local sLast
local sWideWidth

on mouseUp
    local tNumberString
    local tConvertedNumberString
    local tBarWidth

    set the height of graphic "narrowB" to kBarCodeHeight
    put field "barcodeNumber" into tNumberString

    -- need a checksum as the last digit?
    -- put checksumFrom (field "barcodeNumber") after tNumberString

    -- calculate the expected bar widths
    put convertNumberString(tNumberString) into tConvertedNumberString
    put barWidthFrom(tConvertedNumberString) into tBarWidth
    set the width of graphic "narrowB" to tBarWidth
    put tBarWidth * 2 into sWideWidth
    makeBarCodeFrom tConvertedNumberString
    -- add the number string to the barcode if it's not already on the form
    displayBarCodeNumber
end mouseUp

function barWidthFrom pNumberString
    local tHowManyChars
    local tTestString

    put pNumberString into tTestString
    replace "n" with empty in tTestString
    put length (tTestString) + length (pNumberString) into tHowManyChars
    return kBarCodeWidth / tHowManyChars
end barWidthFrom

on makeBarCodeFrom pChars
    local tIsFilled

    lock screen
    if there is a group kBarCodeGroupName then
       delete group kBarCodeGroupName
    end if
    put empty into sLast

    create group kBarCodeGroupName
    set the height of group kBarCodeGroupName to kBarCodeHeight
    set the width of group kBarCodeGroupName to kBarCodeWidth
    put true into tIsFilled
    repeat for each char tChar in pChars
       copy graphic "narrowB" to group kBarCodeGroupName
       switch tChar
          case "w"
             set the width of the last graphic to sWideWidth
             break
       end switch
       if tIsFilled then
          set the visible of the last graphic to true
       end if
       put not tIsFilled into tIsFilled
       if sLast is empty then
          set the topleft of the last graphic to kInitialTopLeft
       else
          set the topleft of the last graphic to horAdjust(kGapBetweenBars)
       end if
       put the short id of the last graphic into sLast -- the id of the
most recently placed bar
    end repeat

    unlock screen
end makeBarCodeFrom

command displayBarCodeNumber
    copy field "barCodeNumber" to group kBarCodeGroupName
    set the opaque of the last field to false
    set the showborder of the last field to false
    set the textalign of the last field to "center"
    set the top of the last field to the bottom of group kBarCodeGroupName
    set the width of the last field to the width of group kBarCodeGroupName
    set the left of the last field to item 1 of kInitialTopLeft
end displayBarCodeNumber

function horAdjust pGap
    local tGap

    put the topright of graphic id sLast into tGap
    set the itemdelimiter to ","
    add pGap to item 1 of tGap
    return tGap
end horAdjust

local sConversionArray

command initializeConversionArray
    put "nnWWn" into sConversionArray["0"]
    put "WnnnW" into sConversionArray["1"]
    put "nWnnW" into sConversionArray["2"]
    put "WWnnn" into sConversionArray["3"]
    put "nnWnW" into sConversionArray["4"]
    put "WnWnn" into sConversionArray["5"]
    put "nWWnn" into sConversionArray["6"]
    put "nnnWW" into sConversionArray["7"]
    put "WnnWn" into sConversionArray["8"]
    put "nWnWn" into sConversionArray["9"]
end initializeConversionArray

function convertNumberString pNumberString
    local tWidthString
    local tString1, tString2
    local x, y

    initializeConversionArray
    put "nnnn" into tWidthString -- four-bar start code
    if the number of chars in pNumberString mod 2 is 1 then
       put "0" before pNumberString
    end if
    -- need to interleave two chars at a time
    repeat with x=1 to length (pNumberString) step 2
       put sConversionArray[char x of pNumberString] into tString1
       put sConversionArray[char x+1 of pNumberString] into tString2
       repeat with y=1 to 5
          put char y of tString1 & char y of tString2 after tWidthString
       end repeat
    end repeat
    put "wnn" after tWidthString -- three-bar stop code
    return tWidthString
end convertNumberString

function checksumFrom pNumberString
    local tEvenNumbers, tOddNumbers
    local tChecksum
    local tResult

    repeat with x=1 to length (pNumberString) step 2
       add char x of pNumberString to tOddNumbers
       add char x+1 of pNumberString to tEvenNumbers
    end repeat
    put tOddNumbers * 3 + tEvenNumbers into tChecksum
    switch tChecksum mod 10
       case 10
          put 0 into tResult
          break
       default
          put 10 - (tChecksum mod 10) into tResult
    end switch
    return tResult
end checksumFrom

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode


> On Jul 20, 2018, at 14:08 , Mark Wieder via use-livecode <[hidden email]> wrote:
>
> On 07/20/2018 04:31 AM, Matthias Rebbe via use-livecode wrote:
>> We tried here with iPhone and also with an USB scanner. Both devices scanned the code successfully.
>> I have just finished a program for shipment. It fetches customer and invoice data from the accounting software and creates then the shipment labels including a Code25i barcode and a QR code. The carrier is Trans-o-Flex. I need to send some sample labels to their IT department. They will check if the labels are readable by their scanners. But i am now confident, that this will work on their side also.
>
> Cool. I played around with Mattias' version of Mike's excellent code a bit. Here's my take. Note that you really only need one graphic image to work with - here's how to do it with a single invisible filled rectangle graphic (I kept the name "narrowB"). This takes a string of numbers and generates the intermediate string and bar code.
> <snip>

THIS is one for the master library!

Bob S



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
In reply to this post by Skip Kimpel via use-livecode
Hey Mark (or anyone?)
Feel like writing up a widget for this (with lots of comments) as an
instructional? (Plus the fact that it'd be a very useful widget in its own
right)

BTW wow.  I toss out a short little ugly hunk of code and you all make it
into something so much better.

On Fri, Jul 20, 2018 at 3:08 PM Mark Wieder via use-livecode <
[hidden email]> wrote:

> On 07/20/2018 04:31 AM, Matthias Rebbe via use-livecode wrote:
> > We tried here with iPhone and also with an USB scanner. Both devices
> scanned the code successfully.
> >
> > I have just finished a program for shipment. It fetches customer and
> invoice data from the accounting software and creates then the shipment
> labels including a Code25i barcode and a QR code. The carrier is
> Trans-o-Flex. I need to send some sample labels to their IT department.
> They will check if the labels are readable by their scanners. But i am now
> confident, that this will work on their side also.
>
> Cool. I played around with Mattias' version of Mike's excellent code a
> bit. Here's my take. Note that you really only need one graphic image to
> work with - here's how to do it with a single invisible filled rectangle
> graphic (I kept the name "narrowB"). This takes a string of numbers and
> generates the intermediate string and bar code.
>
> -- 2of5 barcode
>
> constant kBarCodeHeight = 69
> constant kBarCodeWidth = 360
> constant kInitialTopLeft = "60,286" -- defines where the first bar is
> placed
> constant kGapBetweenBars = 0
> constant kBarCodeGroupName = "barcode2of5"
>
> local sLast
> local sWideWidth
>
> on mouseUp
>     local tNumberString
>     local tConvertedNumberString
>     local tBarWidth
>
>     set the height of graphic "narrowB" to kBarCodeHeight
>     put field "barcodeNumber" into tNumberString
>
>     -- need a checksum as the last digit?
>     -- put checksumFrom (field "barcodeNumber") after tNumberString
>
>     -- calculate the expected bar widths
>     put convertNumberString(tNumberString) into tConvertedNumberString
>     put barWidthFrom(tConvertedNumberString) into tBarWidth
>     set the width of graphic "narrowB" to tBarWidth
>     put tBarWidth * 2 into sWideWidth
>     makeBarCodeFrom tConvertedNumberString
>     -- add the number string to the barcode if it's not already on the form
>     displayBarCodeNumber
> end mouseUp
>
> function barWidthFrom pNumberString
>     local tHowManyChars
>     local tTestString
>
>     put pNumberString into tTestString
>     replace "n" with empty in tTestString
>     put length (tTestString) + length (pNumberString) into tHowManyChars
>     return kBarCodeWidth / tHowManyChars
> end barWidthFrom
>
> on makeBarCodeFrom pChars
>     local tIsFilled
>
>     lock screen
>     if there is a group kBarCodeGroupName then
>        delete group kBarCodeGroupName
>     end if
>     put empty into sLast
>
>     create group kBarCodeGroupName
>     set the height of group kBarCodeGroupName to kBarCodeHeight
>     set the width of group kBarCodeGroupName to kBarCodeWidth
>     put true into tIsFilled
>     repeat for each char tChar in pChars
>        copy graphic "narrowB" to group kBarCodeGroupName
>        switch tChar
>           case "w"
>              set the width of the last graphic to sWideWidth
>              break
>        end switch
>        if tIsFilled then
>           set the visible of the last graphic to true
>        end if
>        put not tIsFilled into tIsFilled
>        if sLast is empty then
>           set the topleft of the last graphic to kInitialTopLeft
>        else
>           set the topleft of the last graphic to horAdjust(kGapBetweenBars)
>        end if
>        put the short id of the last graphic into sLast -- the id of the
> most recently placed bar
>     end repeat
>
>     unlock screen
> end makeBarCodeFrom
>
> command displayBarCodeNumber
>     copy field "barCodeNumber" to group kBarCodeGroupName
>     set the opaque of the last field to false
>     set the showborder of the last field to false
>     set the textalign of the last field to "center"
>     set the top of the last field to the bottom of group kBarCodeGroupName
>     set the width of the last field to the width of group kBarCodeGroupName
>     set the left of the last field to item 1 of kInitialTopLeft
> end displayBarCodeNumber
>
> function horAdjust pGap
>     local tGap
>
>     put the topright of graphic id sLast into tGap
>     set the itemdelimiter to ","
>     add pGap to item 1 of tGap
>     return tGap
> end horAdjust
>
> local sConversionArray
>
> command initializeConversionArray
>     put "nnWWn" into sConversionArray["0"]
>     put "WnnnW" into sConversionArray["1"]
>     put "nWnnW" into sConversionArray["2"]
>     put "WWnnn" into sConversionArray["3"]
>     put "nnWnW" into sConversionArray["4"]
>     put "WnWnn" into sConversionArray["5"]
>     put "nWWnn" into sConversionArray["6"]
>     put "nnnWW" into sConversionArray["7"]
>     put "WnnWn" into sConversionArray["8"]
>     put "nWnWn" into sConversionArray["9"]
> end initializeConversionArray
>
> function convertNumberString pNumberString
>     local tWidthString
>     local tString1, tString2
>     local x, y
>
>     initializeConversionArray
>     put "nnnn" into tWidthString -- four-bar start code
>     if the number of chars in pNumberString mod 2 is 1 then
>        put "0" before pNumberString
>     end if
>     -- need to interleave two chars at a time
>     repeat with x=1 to length (pNumberString) step 2
>        put sConversionArray[char x of pNumberString] into tString1
>        put sConversionArray[char x+1 of pNumberString] into tString2
>        repeat with y=1 to 5
>           put char y of tString1 & char y of tString2 after tWidthString
>        end repeat
>     end repeat
>     put "wnn" after tWidthString -- three-bar stop code
>     return tWidthString
> end convertNumberString
>
> function checksumFrom pNumberString
>     local tEvenNumbers, tOddNumbers
>     local tChecksum
>     local tResult
>
>     repeat with x=1 to length (pNumberString) step 2
>        add char x of pNumberString to tOddNumbers
>        add char x+1 of pNumberString to tEvenNumbers
>     end repeat
>     put tOddNumbers * 3 + tEvenNumbers into tChecksum
>     switch tChecksum mod 10
>        case 10
>           put 0 into tResult
>           break
>        default
>           put 10 - (tChecksum mod 10) into tResult
>     end switch
>     return tResult
> end checksumFrom
>
> --
>   Mark Wieder
>   [hidden email]
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
Ugly is beautiful. A quality all it's own. :-)

Bob S


> On Jul 20, 2018, at 15:22 , Mike Bonner via use-livecode <[hidden email]> wrote:
>
> BTW wow.  I toss out a short little ugly hunk of code and you all make it
> into something so much better.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
In reply to this post by Skip Kimpel via use-livecode
On 07/20/2018 03:22 PM, Mike Bonner via use-livecode wrote:
> Hey Mark (or anyone?)
> Feel like writing up a widget for this (with lots of comments) as an
> instructional? (Plus the fact that it'd be a very useful widget in its own
> right)

Heh. I've got a UPC barcode widget, unfortunately there's no way to
share them via revOnline or whatever. I actually started out modifying
it to generate 2of5 barcodes as well, but the code ended up being much
messier than the LCS version, so I stopped.

Seems to happen every time I go down the widget road. Either there's
a) a better, easier way to do it in LCS or
b) a brick wall I run into where LCB isn't up to the task.

So LCS,LCB,LCD,LSD... gotta flip a coin.

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
In reply to this post by Skip Kimpel via use-livecode
I have to add something.

As I wrote, we were able to successfully scan the labels. This is true as long as we print the labels with a laser printer.

If we print the labels with a thermo printer (203 dpi) then the code cannot be scanned with the values i posted before.
We  had set the line thickness of the rectangles to 0 and had to increase the width of the black bars and decrease the width of the clear ones.

So the code below shows the settings which allow us to scan the labels with a Toshiba B-EV4D and a Zebra LP 2844.

 put “3" into tNarrow
 put “6" into tWide
 set the width of grc "narrowC" to (tNarrow - 2)
 set the width of grc "narrowB" to (tNarrow -3)
 set the width of grc "wideC" to tWide
 set the width of grc "wideB" to tWide

Regards,

Matthias Rebbe


> Am 20.07.2018 um 13:31 schrieb Matthias Rebbe via use-livecode <[hidden email]>:
>
> We tried here with iPhone and also with an USB scanner. Both devices scanned the code successfully.
>
> I have just finished a program for shipment. It fetches customer and invoice data from the accounting software and creates then the shipment labels including a Code25i barcode and a QR code. The carrier is Trans-o-Flex. I need to send some sample labels to their IT department. They will check if the labels are readable by their scanners. But i am now confident, that this will work on their side also.
>
> Thanks again.
>
> Matthias
>
>
>
>> Am 20.07.2018 um 11:31 schrieb Mike Bonner via use-livecode <[hidden email]>:
>>
>> Very cool!  Does it actually produce a code that can be scanned?
>>
>> On Fri, Jul 20, 2018 at 3:25 AM Matthias Rebbe via use-livecode <
>> [hidden email]> wrote:
>>
>>> Mike
>>>
>>> you´re awesome. That is already an almost complete solution to my
>>> question. Never had expected that. Thank you very much.
>>> I´ve made some little changes. One among of them is:
>>> To have all the separate bars of the barcode in a group, i changed the
>>> lines where the grc is cloned
>>> to for example        copy grc “narrowB” to grp “barcode2of5”
>>>
>>> Here´s now my code to convert the nNnNN…. string to Barcode
>>>
>>> local tLast
>>> on mouseup
>>>  if there is a grp "barcode2of5" then delete grp "barcode2of5"
>>>  -- now change the width of the template graphics
>>>  put "2" into tNarrow
>>>  put "4" into tWide
>>>  set the width of grc "narrowC" to tNarrow
>>>  set the width of grc "narrowB" to tNarrow
>>>  set the width of grc "wideC" to tWide
>>>  set the width of grc "wideB" to tWide
>>>  put "0" into tHorAdjust -- allows to put a gap beween the separate bars.
>>>  put "60,286" into tBarTopLeft -- defines where the first bar is placed
>>>  put empty into tLast
>>>  put fld "2of5" into tChars -- the field with your wNnnW string
>>>  set the casesensitive to true -- to differentiate case of course
>>>  create grp "barcode2of5"
>>>  repeat for each char tChar in tChars
>>>     switch tChar
>>>        case "N"
>>>           -- checks the char, and clones the matching bar.
>>>           --if its the first time through, places it at astart location
>>>           -- then uses the id of the most recent bar forplacement
>>> purposes
>>>           --clone grc "narrowB"
>>>           copy grc "narrowB" to grp "barcode2of5"
>>>           if tLast is empty then
>>>              set the topleft of the last grc to tBarTopLeft
>>>           else
>>>              set the topleft of the last grc to horAdjust(tHorAdjust)
>>>           end if
>>>           break
>>>        case "n"
>>>           --clone grc "narrowC"
>>>           copy grc "narrowC" to grp "barcode2of5"
>>>           if tLast is empty then
>>>              set the topleft of the last grc to tBarTopLeft
>>>           else
>>>              set the topleft of the last grc to horAdjust(tHorAdjust)
>>>           end if
>>>           break
>>>        case "W"
>>>           --clone grc "wideB"
>>>           copy grc "wideB" to grp "barcode2of5"
>>>           if tLast is empty then
>>>              set the topleft of the last grc to tBarTopLeft
>>>           else
>>>              set the topleft of the last grc to horAdjust(tHorAdjust)
>>>           end if
>>>           break
>>>        case "w"
>>>           --clone grc "widec"
>>>           copy grc "widec" to grp "barcode2of5"
>>>           if tLast is empty then
>>>              set the topleft of the last grc to tBarTopLeft
>>>           else
>>>              set the topleft of the last grc to horAdjust(tHorAdjust)
>>>           end if
>>>           break
>>>     end switch
>>>     put the short id of the last grc into tLast -- the id of the most
>>> recently placed bar
>>>  end repeat
>>>  set the height of grp "barcode2of5" to 69
>>>  set the width of grp "barcode2of5" to 360
>>> end mouseup
>>>
>>> --This function allows a horizontal adjustment of the single bars.
>>> function horAdjust tHorAdjust
>>>  put the topright of grc id tLast into tTMP
>>>  set the itemdelimiter to ","
>>>  add tHorAdjust to item 1 of tTMP
>>>  return tTMP
>>> end horAdjust
>>>
>>> Again, thank you very much for your help.
>>>
>>> Regards,
>>>
>>> Matthias
>>>
>>>
>>>> Am 20.07.2018 um 01:01 schrieb Mike Bonner via use-livecode <
>>> [hidden email]>:
>>>>
>>>> Not sure if it will work for your purpose, but as a test I created for
>>>> graphic lines, 1 narrow black, 1 wider black, duplicated them and set the
>>>> blendlevel of the copies so that they're transparent.
>>>>
>>>> Grcs are named narrowB, wideB, narrowC and wideC (b for black, c for
>>> clear)
>>>>
>>>> Then used the following code (and your example string from above with the
>>>> WWnNw stuff) to generate a barcode.
>>>>
>>>> on mouseup
>>>> put empty into tLast
>>>> put field 1 into tChars -- the field with your wNnnW string
>>>> set the casesensitive to true -- to differentiate case of course
>>>> repeat for each char tChar in tChars
>>>>    switch tChar
>>>>       case "N" -- checks the char, and clones the matching bar.
>>>>                      --if its the first time through, places it at a
>>>> start location
>>>>                      -- then uses the id of the most recent bar for
>>>> placement purposes
>>>>          clone grc "narrowB"
>>>>          if tLast is empty then
>>>>             set the topleft of the last grc to 10,50
>>>>          else
>>>>             set the topleft of the last grc to the topright of grc id
>>>> tLast
>>>>          end if
>>>>          break
>>>>       case "n"
>>>>          clone grc "narrowC"
>>>>          if tLast is empty then
>>>>             set the topleft of the last grc to 10,50
>>>>          else
>>>>             set the topleft of the last grc to the topright of grc id
>>>> tLast
>>>>          end if
>>>>          break
>>>>       case "W"
>>>>          clone grc "wideB"
>>>>          if tLast is empty then
>>>>             set the topleft of the last grc to 10,50
>>>>          else
>>>>             set the topleft of the last grc to the topright of grc id
>>>> tLast
>>>>          end if
>>>>          break
>>>>       case "w"
>>>>          clone grc "widec"
>>>>          if tLast is empty then
>>>>             set the topleft of the last grc to 10,50
>>>>          else
>>>>             set the topleft of the last grc to the topright of grc id
>>>> tLast
>>>>          end if
>>>>          break
>>>>
>>>>    end switch
>>>>    put the short id of the last grc into tLast -- the id of the most
>>>> recently placed bar
>>>> end repeat
>>>> end mouseup
>>>>
>>>> Spacing and line size might need to be tweaked, but it seems like this
>>>> would be relatively straight forward.
>>>>
>>>> On Thu, Jul 19, 2018 at 4:30 PM Bob Sneidar via use-livecode <
>>>> [hidden email]> wrote:
>>>>
>>>>> I think the trick will be drawing large graphics one at a time and
>>>>> properly spaced at several times their finished size, perhaps off
>>> screen,
>>>>> then getting a snapshot of the result and scaling it down. Not sure how
>>>>> picky the readers will be.
>>>>>
>>>>> Bob S
>>>>>
>>>>>
>>>>>> On Jul 19, 2018, at 15:06 , Matthias Rebbe via use-livecode <
>>>>> [hidden email]> wrote:
>>>>>>
>>>>>> Currently i am using a special 2of5i barcode font. The font .has only
>>>>> four characters (bars) in its set.
>>>>>> The code displays a
>>>>>> narrow space (blank) bar when the character is n
>>>>>> narrow black bar when N
>>>>>> wide space when w
>>>>>> wide black bar when W
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> use-livecode mailing list
>>>>> [hidden email]
>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>> subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
Of course i meant

So the code below shows the settings which allow us to scan the labels when printed with a Toshiba B-EV4D and a Zebra LP 2844.

> Am 22.07.2018 um 23:18 schrieb Matthias Rebbe via use-livecode <[hidden email]>:
>
> I have to add something.
>
> As I wrote, we were able to successfully scan the labels. This is true as long as we print the labels with a laser printer.
>
> If we print the labels with a thermo printer (203 dpi) then the code cannot be scanned with the values i posted before.
> We  had set the line thickness of the rectangles to 0 and had to increase the width of the black bars and decrease the width of the clear ones.
>
> So the code below shows the settings which allow us to scan the labels with a Toshiba B-EV4D and a Zebra LP 2844.
>
> put “3" into tNarrow
> put “6" into tWide
> set the width of grc "narrowC" to (tNarrow - 2)
> set the width of grc "narrowB" to (tNarrow -3)
> set the width of grc "wideC" to tWide
> set the width of grc "wideB" to tWide
>
> Regards,
>
> Matthias Rebbe
>
>
>> Am 20.07.2018 um 13:31 schrieb Matthias Rebbe via use-livecode <[hidden email]>:
>>
>> We tried here with iPhone and also with an USB scanner. Both devices scanned the code successfully.
>>
>> I have just finished a program for shipment. It fetches customer and invoice data from the accounting software and creates then the shipment labels including a Code25i barcode and a QR code. The carrier is Trans-o-Flex. I need to send some sample labels to their IT department. They will check if the labels are readable by their scanners. But i am now confident, that this will work on their side also.
>>
>> Thanks again.
>>
>> Matthias
>>
>>
>>
>>> Am 20.07.2018 um 11:31 schrieb Mike Bonner via use-livecode <[hidden email]>:
>>>
>>> Very cool!  Does it actually produce a code that can be scanned?
>>>
>>> On Fri, Jul 20, 2018 at 3:25 AM Matthias Rebbe via use-livecode <
>>> [hidden email]> wrote:
>>>
>>>> Mike
>>>>
>>>> you´re awesome. That is already an almost complete solution to my
>>>> question. Never had expected that. Thank you very much.
>>>> I´ve made some little changes. One among of them is:
>>>> To have all the separate bars of the barcode in a group, i changed the
>>>> lines where the grc is cloned
>>>> to for example        copy grc “narrowB” to grp “barcode2of5”
>>>>
>>>> Here´s now my code to convert the nNnNN…. string to Barcode
>>>>
>>>> local tLast
>>>> on mouseup
>>>> if there is a grp "barcode2of5" then delete grp "barcode2of5"
>>>> -- now change the width of the template graphics
>>>> put "2" into tNarrow
>>>> put "4" into tWide
>>>> set the width of grc "narrowC" to tNarrow
>>>> set the width of grc "narrowB" to tNarrow
>>>> set the width of grc "wideC" to tWide
>>>> set the width of grc "wideB" to tWide
>>>> put "0" into tHorAdjust -- allows to put a gap beween the separate bars.
>>>> put "60,286" into tBarTopLeft -- defines where the first bar is placed
>>>> put empty into tLast
>>>> put fld "2of5" into tChars -- the field with your wNnnW string
>>>> set the casesensitive to true -- to differentiate case of course
>>>> create grp "barcode2of5"
>>>> repeat for each char tChar in tChars
>>>>    switch tChar
>>>>       case "N"
>>>>          -- checks the char, and clones the matching bar.
>>>>          --if its the first time through, places it at astart location
>>>>          -- then uses the id of the most recent bar forplacement
>>>> purposes
>>>>          --clone grc "narrowB"
>>>>          copy grc "narrowB" to grp "barcode2of5"
>>>>          if tLast is empty then
>>>>             set the topleft of the last grc to tBarTopLeft
>>>>          else
>>>>             set the topleft of the last grc to horAdjust(tHorAdjust)
>>>>          end if
>>>>          break
>>>>       case "n"
>>>>          --clone grc "narrowC"
>>>>          copy grc "narrowC" to grp "barcode2of5"
>>>>          if tLast is empty then
>>>>             set the topleft of the last grc to tBarTopLeft
>>>>          else
>>>>             set the topleft of the last grc to horAdjust(tHorAdjust)
>>>>          end if
>>>>          break
>>>>       case "W"
>>>>          --clone grc "wideB"
>>>>          copy grc "wideB" to grp "barcode2of5"
>>>>          if tLast is empty then
>>>>             set the topleft of the last grc to tBarTopLeft
>>>>          else
>>>>             set the topleft of the last grc to horAdjust(tHorAdjust)
>>>>          end if
>>>>          break
>>>>       case "w"
>>>>          --clone grc "widec"
>>>>          copy grc "widec" to grp "barcode2of5"
>>>>          if tLast is empty then
>>>>             set the topleft of the last grc to tBarTopLeft
>>>>          else
>>>>             set the topleft of the last grc to horAdjust(tHorAdjust)
>>>>          end if
>>>>          break
>>>>    end switch
>>>>    put the short id of the last grc into tLast -- the id of the most
>>>> recently placed bar
>>>> end repeat
>>>> set the height of grp "barcode2of5" to 69
>>>> set the width of grp "barcode2of5" to 360
>>>> end mouseup
>>>>
>>>> --This function allows a horizontal adjustment of the single bars.
>>>> function horAdjust tHorAdjust
>>>> put the topright of grc id tLast into tTMP
>>>> set the itemdelimiter to ","
>>>> add tHorAdjust to item 1 of tTMP
>>>> return tTMP
>>>> end horAdjust
>>>>
>>>> Again, thank you very much for your help.
>>>>
>>>> Regards,
>>>>
>>>> Matthias
>>>>
>>>>
>>>>> Am 20.07.2018 um 01:01 schrieb Mike Bonner via use-livecode <
>>>> [hidden email]>:
>>>>>
>>>>> Not sure if it will work for your purpose, but as a test I created for
>>>>> graphic lines, 1 narrow black, 1 wider black, duplicated them and set the
>>>>> blendlevel of the copies so that they're transparent.
>>>>>
>>>>> Grcs are named narrowB, wideB, narrowC and wideC (b for black, c for
>>>> clear)
>>>>>
>>>>> Then used the following code (and your example string from above with the
>>>>> WWnNw stuff) to generate a barcode.
>>>>>
>>>>> on mouseup
>>>>> put empty into tLast
>>>>> put field 1 into tChars -- the field with your wNnnW string
>>>>> set the casesensitive to true -- to differentiate case of course
>>>>> repeat for each char tChar in tChars
>>>>>   switch tChar
>>>>>      case "N" -- checks the char, and clones the matching bar.
>>>>>                     --if its the first time through, places it at a
>>>>> start location
>>>>>                     -- then uses the id of the most recent bar for
>>>>> placement purposes
>>>>>         clone grc "narrowB"
>>>>>         if tLast is empty then
>>>>>            set the topleft of the last grc to 10,50
>>>>>         else
>>>>>            set the topleft of the last grc to the topright of grc id
>>>>> tLast
>>>>>         end if
>>>>>         break
>>>>>      case "n"
>>>>>         clone grc "narrowC"
>>>>>         if tLast is empty then
>>>>>            set the topleft of the last grc to 10,50
>>>>>         else
>>>>>            set the topleft of the last grc to the topright of grc id
>>>>> tLast
>>>>>         end if
>>>>>         break
>>>>>      case "W"
>>>>>         clone grc "wideB"
>>>>>         if tLast is empty then
>>>>>            set the topleft of the last grc to 10,50
>>>>>         else
>>>>>            set the topleft of the last grc to the topright of grc id
>>>>> tLast
>>>>>         end if
>>>>>         break
>>>>>      case "w"
>>>>>         clone grc "widec"
>>>>>         if tLast is empty then
>>>>>            set the topleft of the last grc to 10,50
>>>>>         else
>>>>>            set the topleft of the last grc to the topright of grc id
>>>>> tLast
>>>>>         end if
>>>>>         break
>>>>>
>>>>>   end switch
>>>>>   put the short id of the last grc into tLast -- the id of the most
>>>>> recently placed bar
>>>>> end repeat
>>>>> end mouseup
>>>>>
>>>>> Spacing and line size might need to be tweaked, but it seems like this
>>>>> would be relatively straight forward.
>>>>>
>>>>> On Thu, Jul 19, 2018 at 4:30 PM Bob Sneidar via use-livecode <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>> I think the trick will be drawing large graphics one at a time and
>>>>>> properly spaced at several times their finished size, perhaps off
>>>> screen,
>>>>>> then getting a snapshot of the result and scaling it down. Not sure how
>>>>>> picky the readers will be.
>>>>>>
>>>>>> Bob S
>>>>>>
>>>>>>
>>>>>>> On Jul 19, 2018, at 15:06 , Matthias Rebbe via use-livecode <
>>>>>> [hidden email]> wrote:
>>>>>>>
>>>>>>> Currently i am using a special 2of5i barcode font. The font .has only
>>>>>> four characters (bars) in its set.
>>>>>>> The code displays a
>>>>>>> narrow space (blank) bar when the character is n
>>>>>>> narrow black bar when N
>>>>>>> wide space when w
>>>>>>> wide black bar when W
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> use-livecode mailing list
>>>>>> [hidden email]
>>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>>> subscription preferences:
>>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>>>
>>>>> _______________________________________________
>>>>> use-livecode mailing list
>>>>> [hidden email]
>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
I wonder what would happen if you turned the bar code by 90 degrees and
then printed it? Could it be scanned then?

Just a wild thought...

Phil Davis


On 7/22/18 2:43 PM, Matthias Rebbe via use-livecode wrote:

> Of course i meant
>
> So the code below shows the settings which allow us to scan the labels when printed with a Toshiba B-EV4D and a Zebra LP 2844.
>
>> Am 22.07.2018 um 23:18 schrieb Matthias Rebbe via use-livecode <[hidden email]>:
>>
>> I have to add something.
>>
>> As I wrote, we were able to successfully scan the labels. This is true as long as we print the labels with a laser printer.
>>
>> If we print the labels with a thermo printer (203 dpi) then the code cannot be scanned with the values i posted before.
>> We  had set the line thickness of the rectangles to 0 and had to increase the width of the black bars and decrease the width of the clear ones.
>>
>> So the code below shows the settings which allow us to scan the labels with a Toshiba B-EV4D and a Zebra LP 2844.
>>
>> put “3" into tNarrow
>> put “6" into tWide
>> set the width of grc "narrowC" to (tNarrow - 2)
>> set the width of grc "narrowB" to (tNarrow -3)
>> set the width of grc "wideC" to tWide
>> set the width of grc "wideB" to tWide
>>
>> Regards,
>>
>> Matthias Rebbe
>>
>>
>>> Am 20.07.2018 um 13:31 schrieb Matthias Rebbe via use-livecode <[hidden email]>:
>>>
>>> We tried here with iPhone and also with an USB scanner. Both devices scanned the code successfully.
>>>
>>> I have just finished a program for shipment. It fetches customer and invoice data from the accounting software and creates then the shipment labels including a Code25i barcode and a QR code. The carrier is Trans-o-Flex. I need to send some sample labels to their IT department. They will check if the labels are readable by their scanners. But i am now confident, that this will work on their side also.
>>>
>>> Thanks again.
>>>
>>> Matthias
>>>
>>>
>>>
>>>> Am 20.07.2018 um 11:31 schrieb Mike Bonner via use-livecode <[hidden email]>:
>>>>
>>>> Very cool!  Does it actually produce a code that can be scanned?
>>>>
>>>> On Fri, Jul 20, 2018 at 3:25 AM Matthias Rebbe via use-livecode <
>>>> [hidden email]> wrote:
>>>>
>>>>> Mike
>>>>>
>>>>> you´re awesome. That is already an almost complete solution to my
>>>>> question. Never had expected that. Thank you very much.
>>>>> I´ve made some little changes. One among of them is:
>>>>> To have all the separate bars of the barcode in a group, i changed the
>>>>> lines where the grc is cloned
>>>>> to for example        copy grc “narrowB” to grp “barcode2of5”
>>>>>
>>>>> Here´s now my code to convert the nNnNN…. string to Barcode
>>>>>
>>>>> local tLast
>>>>> on mouseup
>>>>> if there is a grp "barcode2of5" then delete grp "barcode2of5"
>>>>> -- now change the width of the template graphics
>>>>> put "2" into tNarrow
>>>>> put "4" into tWide
>>>>> set the width of grc "narrowC" to tNarrow
>>>>> set the width of grc "narrowB" to tNarrow
>>>>> set the width of grc "wideC" to tWide
>>>>> set the width of grc "wideB" to tWide
>>>>> put "0" into tHorAdjust -- allows to put a gap beween the separate bars.
>>>>> put "60,286" into tBarTopLeft -- defines where the first bar is placed
>>>>> put empty into tLast
>>>>> put fld "2of5" into tChars -- the field with your wNnnW string
>>>>> set the casesensitive to true -- to differentiate case of course
>>>>> create grp "barcode2of5"
>>>>> repeat for each char tChar in tChars
>>>>>     switch tChar
>>>>>        case "N"
>>>>>           -- checks the char, and clones the matching bar.
>>>>>           --if its the first time through, places it at astart location
>>>>>           -- then uses the id of the most recent bar forplacement
>>>>> purposes
>>>>>           --clone grc "narrowB"
>>>>>           copy grc "narrowB" to grp "barcode2of5"
>>>>>           if tLast is empty then
>>>>>              set the topleft of the last grc to tBarTopLeft
>>>>>           else
>>>>>              set the topleft of the last grc to horAdjust(tHorAdjust)
>>>>>           end if
>>>>>           break
>>>>>        case "n"
>>>>>           --clone grc "narrowC"
>>>>>           copy grc "narrowC" to grp "barcode2of5"
>>>>>           if tLast is empty then
>>>>>              set the topleft of the last grc to tBarTopLeft
>>>>>           else
>>>>>              set the topleft of the last grc to horAdjust(tHorAdjust)
>>>>>           end if
>>>>>           break
>>>>>        case "W"
>>>>>           --clone grc "wideB"
>>>>>           copy grc "wideB" to grp "barcode2of5"
>>>>>           if tLast is empty then
>>>>>              set the topleft of the last grc to tBarTopLeft
>>>>>           else
>>>>>              set the topleft of the last grc to horAdjust(tHorAdjust)
>>>>>           end if
>>>>>           break
>>>>>        case "w"
>>>>>           --clone grc "widec"
>>>>>           copy grc "widec" to grp "barcode2of5"
>>>>>           if tLast is empty then
>>>>>              set the topleft of the last grc to tBarTopLeft
>>>>>           else
>>>>>              set the topleft of the last grc to horAdjust(tHorAdjust)
>>>>>           end if
>>>>>           break
>>>>>     end switch
>>>>>     put the short id of the last grc into tLast -- the id of the most
>>>>> recently placed bar
>>>>> end repeat
>>>>> set the height of grp "barcode2of5" to 69
>>>>> set the width of grp "barcode2of5" to 360
>>>>> end mouseup
>>>>>
>>>>> --This function allows a horizontal adjustment of the single bars.
>>>>> function horAdjust tHorAdjust
>>>>> put the topright of grc id tLast into tTMP
>>>>> set the itemdelimiter to ","
>>>>> add tHorAdjust to item 1 of tTMP
>>>>> return tTMP
>>>>> end horAdjust
>>>>>
>>>>> Again, thank you very much for your help.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Matthias
>>>>>
>>>>>
>>>>>> Am 20.07.2018 um 01:01 schrieb Mike Bonner via use-livecode <
>>>>> [hidden email]>:
>>>>>> Not sure if it will work for your purpose, but as a test I created for
>>>>>> graphic lines, 1 narrow black, 1 wider black, duplicated them and set the
>>>>>> blendlevel of the copies so that they're transparent.
>>>>>>
>>>>>> Grcs are named narrowB, wideB, narrowC and wideC (b for black, c for
>>>>> clear)
>>>>>> Then used the following code (and your example string from above with the
>>>>>> WWnNw stuff) to generate a barcode.
>>>>>>
>>>>>> on mouseup
>>>>>> put empty into tLast
>>>>>> put field 1 into tChars -- the field with your wNnnW string
>>>>>> set the casesensitive to true -- to differentiate case of course
>>>>>> repeat for each char tChar in tChars
>>>>>>    switch tChar
>>>>>>       case "N" -- checks the char, and clones the matching bar.
>>>>>>                      --if its the first time through, places it at a
>>>>>> start location
>>>>>>                      -- then uses the id of the most recent bar for
>>>>>> placement purposes
>>>>>>          clone grc "narrowB"
>>>>>>          if tLast is empty then
>>>>>>             set the topleft of the last grc to 10,50
>>>>>>          else
>>>>>>             set the topleft of the last grc to the topright of grc id
>>>>>> tLast
>>>>>>          end if
>>>>>>          break
>>>>>>       case "n"
>>>>>>          clone grc "narrowC"
>>>>>>          if tLast is empty then
>>>>>>             set the topleft of the last grc to 10,50
>>>>>>          else
>>>>>>             set the topleft of the last grc to the topright of grc id
>>>>>> tLast
>>>>>>          end if
>>>>>>          break
>>>>>>       case "W"
>>>>>>          clone grc "wideB"
>>>>>>          if tLast is empty then
>>>>>>             set the topleft of the last grc to 10,50
>>>>>>          else
>>>>>>             set the topleft of the last grc to the topright of grc id
>>>>>> tLast
>>>>>>          end if
>>>>>>          break
>>>>>>       case "w"
>>>>>>          clone grc "widec"
>>>>>>          if tLast is empty then
>>>>>>             set the topleft of the last grc to 10,50
>>>>>>          else
>>>>>>             set the topleft of the last grc to the topright of grc id
>>>>>> tLast
>>>>>>          end if
>>>>>>          break
>>>>>>
>>>>>>    end switch
>>>>>>    put the short id of the last grc into tLast -- the id of the most
>>>>>> recently placed bar
>>>>>> end repeat
>>>>>> end mouseup
>>>>>>
>>>>>> Spacing and line size might need to be tweaked, but it seems like this
>>>>>> would be relatively straight forward.
>>>>>>
>>>>>> On Thu, Jul 19, 2018 at 4:30 PM Bob Sneidar via use-livecode <
>>>>>> [hidden email]> wrote:
>>>>>>
>>>>>>> I think the trick will be drawing large graphics one at a time and
>>>>>>> properly spaced at several times their finished size, perhaps off
>>>>> screen,
>>>>>>> then getting a snapshot of the result and scaling it down. Not sure how
>>>>>>> picky the readers will be.
>>>>>>>
>>>>>>> Bob S
>>>>>>>
>>>>>>>
>>>>>>>> On Jul 19, 2018, at 15:06 , Matthias Rebbe via use-livecode <
>>>>>>> [hidden email]> wrote:
>>>>>>>> Currently i am using a special 2of5i barcode font. The font .has only
>>>>>>> four characters (bars) in its set.
>>>>>>>> The code displays a
>>>>>>>> narrow space (blank) bar when the character is n
>>>>>>>> narrow black bar when N
>>>>>>>> wide space when w
>>>>>>>> wide black bar when W
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> use-livecode mailing list
>>>>>>> [hidden email]
>>>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>>>> subscription preferences:
>>>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>>>>
>>>>>> _______________________________________________
>>>>>> use-livecode mailing list
>>>>>> [hidden email]
>>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>> subscription preferences:
>>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>>
>>>>> _______________________________________________
>>>>> use-livecode mailing list
>>>>> [hidden email]
>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>> subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]
>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Phil Davis


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
In reply to this post by Skip Kimpel via use-livecode
Out of curiosity, does printed barcodes from the laserwriter still work with these settings?

Bob S


> On Jul 22, 2018, at 14:18 , Matthias Rebbe via use-livecode <[hidden email]> wrote:
>
> I have to add something.
>
> As I wrote, we were able to successfully scan the labels. This is true as long as we print the labels with a laser printer.
>
> If we print the labels with a thermo printer (203 dpi) then the code cannot be scanned with the values i posted before.
> We  had set the line thickness of the rectangles to 0 and had to increase the width of the black bars and decrease the width of the clear ones.
>
> So the code below shows the settings which allow us to scan the labels with a Toshiba B-EV4D and a Zebra LP 2844.
>
> put “3" into tNarrow
> put “6" into tWide
> set the width of grc "narrowC" to (tNarrow - 2)
> set the width of grc "narrowB" to (tNarrow -3)
> set the width of grc "wideC" to tWide
> set the width of grc "wideB" to tWide
>
> Regards,
>
> Matthias Rebbe

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
In reply to this post by Skip Kimpel via use-livecode
> Matthias wrote:
>
> If we print the labels with a thermo printer (203 dpi) then the code cannot be scanned with the values i posted before.
> We  had set the line thickness of the rectangles to 0 and had to increase the width of the black bars and decrease the width of the clear ones.


I wonder if it would make a difference to print snapshots of the graphic group rather then the group itself?

Jim Lambert
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
What up Matthias?
You're using 2 of 5, right?
TT can be a little messy depending on how small you try to make the
barcodes, and that Zebra isn't going to help.  Start with proportionally
jacking the widths and then see if you can scan.
I meant to ask you this before, but since you got it running I was leaving
it alone.  Is there any reason to not use a 2 of 5 font?  That would at
least remove one potential issue from your setup.

On Mon, Jul 23, 2018 at 6:35 PM Jim Lambert via use-livecode <
[hidden email]> wrote:

> > Matthias wrote:
> >
> > If we print the labels with a thermo printer (203 dpi) then the code
> cannot be scanned with the values i posted before.
> > We  had set the line thickness of the rectangles to 0 and had to
> increase the width of the black bars and decrease the width of the clear
> ones.
>
>
> I wonder if it would make a difference to print snapshots of the graphic
> group rather then the group itself?
>
> Jim Lambert
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: drawing a Barcode without a Barcode font

Skip Kimpel via use-livecode
I kind of was referring to this in my prior post. Figure out the minimum resolution you are printing to, then make your bars and white spaces in some increment of that, then screenshot and scale as necessary. We have ERP software that prints barcode labels for inventory, but the barcode readers that use the iPhone camera don't read them well, probably because the barcodes are printed with a thermal printer and the resolution kinda sucks.

Bob S


> On Jul 25, 2018, at 05:38 , Mike Kerner via use-livecode <[hidden email]> wrote:
>
> What up Matthias?
> You're using 2 of 5, right?
> TT can be a little messy depending on how small you try to make the
> barcodes, and that Zebra isn't going to help.  Start with proportionally
> jacking the widths and then see if you can scan.
> I meant to ask you this before, but since you got it running I was leaving
> it alone.  Is there any reason to not use a 2 of 5 font?  That would at
> least remove one potential issue from your setup.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12