[Pharo-dev] Barcodes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Pharo-dev] Barcodes

Torsten Bergmann
Do we have some barcode stuff available for Pharo?
Something "Form" based that can be used with Artefact?

Thx
T.

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

mmimica
You just need a TTF font. Does Artefact support TTF? hpdf does.


On 14 June 2013 13:58, Torsten Bergmann <[hidden email]> wrote:
Do we have some barcode stuff available for Pharo?
Something "Form" based that can be used with Artefact?

Thx
T.




--
Milan Mimica
http://sparklet.sf.net
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Olivier Auverlot
Hi Torsten,

Artefact don't support TTF fonts for the moment but it's planned in futures versions.

Best regards
Olivier :-)

Le 14 juin 2013 à 16:16, Milan Mimica a écrit :

You just need a TTF font. Does Artefact support TTF? hpdf does.


On 14 June 2013 13:58, Torsten Bergmann <[hidden email]> wrote:
Do we have some barcode stuff available for Pharo?
Something "Form" based that can be used with Artefact?

Thx
T.




--
Milan Mimica
http://sparklet.sf.net

cbc
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

cbc
You should be able to create a form, paint it white, draw on it with a barcode TTF font, export that form to JPEG, and then use that JPEG into Artefact.

Not really straight-forward, but it should work.

*Note: I've found that writing JPEG's in Pharo, it assumes that the background is BLACK if it isn't isn't specifically painted with something else first.  Unlike PNG and GIF, which assume WHITE.

-Chris


On Tue, Jun 18, 2013 at 1:44 AM, Olivier Auverlot <[hidden email]> wrote:
Hi Torsten,

Artefact don't support TTF fonts for the moment but it's planned in futures versions.

Best regards
Olivier :-)

Le 14 juin 2013 à 16:16, Milan Mimica a écrit :

You just need a TTF font. Does Artefact support TTF? hpdf does.


On 14 June 2013 13:58, Torsten Bergmann <[hidden email]> wrote:
Do we have some barcode stuff available for Pharo?
Something "Form" based that can be used with Artefact?

Thx
T.




--
Milan Mimica
http://sparklet.sf.net


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Gary Chambers-4
Well, hoping to work with Torsten on barcodes in general, given we have support for canvas based drawing of a few formats here at Pinesoft.
 
Also, if Olivier would like some help with TTF in PDFs I can give some pointers etc.

Regards, Gary
----- Original Message -----
Sent: Tuesday, June 18, 2013 5:23 PM
Subject: Re: [Pharo-dev] Barcodes

You should be able to create a form, paint it white, draw on it with a barcode TTF font, export that form to JPEG, and then use that JPEG into Artefact.

Not really straight-forward, but it should work.

*Note: I've found that writing JPEG's in Pharo, it assumes that the background is BLACK if it isn't isn't specifically painted with something else first.  Unlike PNG and GIF, which assume WHITE.

-Chris


On Tue, Jun 18, 2013 at 1:44 AM, Olivier Auverlot <[hidden email]> wrote:
Hi Torsten,

Artefact don't support TTF fonts for the moment but it's planned in futures versions.

Best regards
Olivier :-)

Le 14 juin 2013 à 16:16, Milan Mimica a écrit :

You just need a TTF font. Does Artefact support TTF? hpdf does.


On 14 June 2013 13:58, Torsten Bergmann <[hidden email]> wrote:
Do we have some barcode stuff available for Pharo?
Something "Form" based that can be used with Artefact?

Thx
T.




--
Milan Mimica
http://sparklet.sf.net


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Stéphane Ducasse
<base href="x-msg://10531/">Hello Gary

I'm sure that Olivier is interested.

Stef

On Jun 18, 2013, at 6:37 PM, "Gary Chambers" <[hidden email]> wrote:

Well, hoping to work with Torsten on barcodes in general, given we have support for canvas based drawing of a few formats here at Pinesoft.
 
Also, if Olivier would like some help with TTF in PDFs I can give some pointers etc.

Regards, Gary
----- Original Message -----
Sent: Tuesday, June 18, 2013 5:23 PM
Subject: Re: [Pharo-dev] Barcodes

You should be able to create a form, paint it white, draw on it with a barcode TTF font, export that form to JPEG, and then use that JPEG into Artefact.

Not really straight-forward, but it should work.

*Note: I've found that writing JPEG's in Pharo, it assumes that the background is BLACK if it isn't isn't specifically painted with something else first.  Unlike PNG and GIF, which assume WHITE.

-Chris


On Tue, Jun 18, 2013 at 1:44 AM, Olivier Auverlot<[hidden email]> wrote:
Hi Torsten,

Artefact don't support TTF fonts for the moment but it's planned in futures versions.

Best regards
Olivier :-)

Le 14 juin 2013 à 16:16, Milan Mimica a écrit :

You just need a TTF font. Does Artefact support TTF? hpdf does.


On 14 June 2013 13:58, Torsten Bergmann <[hidden email]> wrote:
Do we have some barcode stuff available for Pharo?
Something "Form" based that can be used with Artefact?

Thx
T.




-- 
Milan Mimica
http://sparklet.sf.net

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Stephan Eggermont-3
In reply to this post by Torsten Bergmann
Chris wrote:
>You should be able to create a form, paint it white, draw on it with a barcode TTF font, export that form to JPEG, and >then use that JPEG into Artefact.

That won't work. Barcode readers need clean black-white transitions and that is something
JPEG compression cannot provide (unless printing large enough at high enough resolution,
and low enough compression). To get good-working barcodes, you even need to align to
printer pixels.

Stephan
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Olivier Auverlot
In reply to this post by Gary Chambers-4
<base href="x-msg://46/">Hi Gary,

yes, I'm interested by help and pointers about TTF. It's a planned evolution of Artefact.

About barcodes generation, why don't use Artefact directly ?  You can draw barcodes with the PDFDraw elements (PDFLineElement, PDFRectElement, etc.) and print the document on stickers.  

In the future, it could be cool to have a Artefact-Elements-Barcodes package :)

Best regards
Olivier

Le 18 juin 2013 à 18:37, Gary Chambers a écrit :

Well, hoping to work with Torsten on barcodes in general, given we have support for canvas based drawing of a few formats here at Pinesoft.
 
Also, if Olivier would like some help with TTF in PDFs I can give some pointers etc.

Regards, Gary
----- Original Message -----
Sent: Tuesday, June 18, 2013 5:23 PM
Subject: Re: [Pharo-dev] Barcodes

You should be able to create a form, paint it white, draw on it with a barcode TTF font, export that form to JPEG, and then use that JPEG into Artefact.

Not really straight-forward, but it should work.

*Note: I've found that writing JPEG's in Pharo, it assumes that the background is BLACK if it isn't isn't specifically painted with something else first.  Unlike PNG and GIF, which assume WHITE.

-Chris


On Tue, Jun 18, 2013 at 1:44 AM, Olivier Auverlot <[hidden email]> wrote:
Hi Torsten,

Artefact don't support TTF fonts for the moment but it's planned in futures versions.

Best regards
Olivier :-)

Le 14 juin 2013 à 16:16, Milan Mimica a écrit :

You just need a TTF font. Does Artefact support TTF? hpdf does.


On 14 June 2013 13:58, Torsten Bergmann <[hidden email]> wrote:
Do we have some barcode stuff available for Pharo?
Something "Form" based that can be used with Artefact?

Thx
T.




-- 
Milan Mimica
http://sparklet.sf.net

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Gary Chambers-4
<BASE href="x-msg://46/">
Hi Olivier.
 
For our label/report generation we do draw the barcodes rather than use a Form. Actually we have a Canvas that adapts to generate PDF so it is all WYSIWYG. Therefore no actual dependency in the PDF generation to any barcode objects.
 
Looking to support Arefact instead of the stuff we have. Not looked at the details of Artefact yet though.
 
TTF in PDF is not so bad... a snippet of what's expected in the output:
 
6 0 obj
<<
/Type /Font
/Subtype /TrueType
/BaseFont /Arial
/FirstChar 0
/LastChar 255
/Widths 8 0 R
/FontDescriptor 9 0 R
/Encoding /WinAnsiEncoding
>>
endobj
9 0 obj
<<
/Type /FontDescriptor
/FontName /Arial
/Flags 32
/FontBBox [-665 -325 2000 1005]
/Ascent 905
/Descent -212
/Leading 0
/ItalicAngle 0
>>
endobj
8 0 obj
[ 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 277 277 354 556 556 889 666 190 333 333 389 583 277 333 277 277 556 556 556 556 556 556 556 556 556 556 277 277 583 583 583 556 1015 666 666 722 722 666 610 777 722 277 500 666 556 833 722 777 666 777 722 666 610 722 666 943 666 666 610 277 277 277 469 556 333 556 556 500 556 556 277 556 556 222 222 500 222 833 556 556 556 556 333 500 277 556 500 722 500 500 500 333 259 333 583 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 277 333 556 556 556 556 259 556 333 736 370 556 583 333 736 552 399 548 333 333 333 576 537 333 333 333 365 556 833 833 833 610 666 666 666 666 666 666 1000 722 666 666 666 666 277 277 277 277 722 722 777 777 777 777 777 583 777 722 722 722 722 666 666 610 556 556 556 556 556 556 889 500 556 556 556 556 277 277 277 277 556 556 556 556 556 556 556 548 610 556 556 556 556 500 556 500 ]
endobj
 
 
(actually we now use MacRoman encoding as generally works better).
All the data there can be gatherted from the FreeType TTF font in Pharo. Just needs to be present on the end-user's pc.
A typical PDF reader will do fallbacks as necessary if not present.
(not tackled fully embedded fonts yet).

Regards, Gary
----- Original Message -----
Sent: Wednesday, June 19, 2013 6:42 AM
Subject: Re: [Pharo-dev] Barcodes

Hi Gary,

yes, I'm interested by help and pointers about TTF. It's a planned evolution of Artefact.

About barcodes generation, why don't use Artefact directly ?  You can draw barcodes with the PDFDraw elements (PDFLineElement, PDFRectElement, etc.) and print the document on stickers.  

In the future, it could be cool to have a Artefact-Elements-Barcodes package :)

Best regards
Olivier

Le 18 juin 2013 à 18:37, Gary Chambers a écrit :

Well, hoping to work with Torsten on barcodes in general, given we have support for canvas based drawing of a few formats here at Pinesoft.
 
Also, if Olivier would like some help with TTF in PDFs I can give some pointers etc.

Regards, Gary
----- Original Message -----
Sent: Tuesday, June 18, 2013 5:23 PM
Subject: Re: [Pharo-dev] Barcodes

You should be able to create a form, paint it white, draw on it with a barcode TTF font, export that form to JPEG, and then use that JPEG into Artefact.

Not really straight-forward, but it should work.

*Note: I've found that writing JPEG's in Pharo, it assumes that the background is BLACK if it isn't isn't specifically painted with something else first.  Unlike PNG and GIF, which assume WHITE.

-Chris


On Tue, Jun 18, 2013 at 1:44 AM, Olivier Auverlot <[hidden email]> wrote:
Hi Torsten,

Artefact don't support TTF fonts for the moment but it's planned in futures versions.

Best regards
Olivier :-)

Le 14 juin 2013 à 16:16, Milan Mimica a écrit :

You just need a TTF font. Does Artefact support TTF? hpdf does.


On 14 June 2013 13:58, Torsten Bergmann <[hidden email]> wrote:
Do we have some barcode stuff available for Pharo?
Something "Form" based that can be used with Artefact?

Thx
T.




-- 
Milan Mimica
http://sparklet.sf.net

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Stephan Eggermont-3
In reply to this post by Torsten Bergmann
So, this kind-of works. Both Artefact and Barcode repositories are not writable,
so here is an artefact package that depends on barcode.



ean13Test: aStream
        "drawing an EAN13"

        | pdfdoc aPage barcode sequence |
        barcode := BarcodeEAN13 value: '2109876543210'.
        sequence := barcode binarySequence.
        pdfdoc := PDFDocument new.
        aPage := PDFPage new.
        sequence withIndexDo: [:each :index |
                each = $1 ifTrue: [
                        aPage add: (PDFLineElement
                                from: (20+index) pt @ 50 pt
                                to: (20+index) pt @ 20 pt). ] ].
        pdfdoc add: aPage.
        pdfdoc styleSheet drawColor: (PDFColor r: 0 g: 0 b: 0).
pdfdoc exportTo: aStream



Artefact-Barcodes.st (1K) Download Attachment
ean13Test.pdf (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Olivier Auverlot
In reply to this post by Gary Chambers-4
<base href="x-msg://46/">Hi Gary,

Thanks for this informations. It's very interesting.

All the data there can be gatherted from the FreeType TTF font in Pharo. Just needs to be present on the end-user's pc.

Have you already wrote code to extract the informations from a TTF font ? If someone has exploring this domain, we could write faster the implementation. 

Best regards
Olivier ;-)

Le 19 juin 2013 à 18:05, Gary Chambers a écrit :

Hi Olivier.
 
For our label/report generation we do draw the barcodes rather than use a Form. Actually we have a Canvas that adapts to generate PDF so it is all WYSIWYG. Therefore no actual dependency in the PDF generation to any barcode objects.
 
Looking to support Arefact instead of the stuff we have. Not looked at the details of Artefact yet though.
 
TTF in PDF is not so bad... a snippet of what's expected in the output:
 
6 0 obj
<<
/Type /Font
/Subtype /TrueType
/BaseFont /Arial
/FirstChar 0
/LastChar 255
/Widths 8 0 R
/FontDescriptor 9 0 R
/Encoding /WinAnsiEncoding
>>
endobj
9 0 obj
<<
/Type /FontDescriptor
/FontName /Arial
/Flags 32
/FontBBox [-665 -325 2000 1005]
/Ascent 905
/Descent -212
/Leading 0
/ItalicAngle 0
>>
endobj
8 0 obj
[ 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750  750 750 277 277 354 556 556 889 666 190 333 333 389 583 277 333 277 277 556 556 556 556 556 556 556 556 556 556 277 277 583 583 583 556 1015 666 666 722 722 666 610 777 722 277 500 666 556 833 722 777 666 777 722 666 610 722 666 943 666 666  610 277 277 277 469 556 333 556 556 500 556 556 277 556 556 222 222 500 222 833 556 556 556 556 333 500 277 556 500 722 500 500 500 333 259 333 583 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 750 277 333 556 556 556 556 259 556 333 736 370 556 583 333 736 552 399 548 333 333 333 576 537 333 333 333 365 556 833 833 833 610 666 666 666 666 666 666 1000 722 666 666 666 666 277 277 277 277 722 722  777 777 777 777 777 583 777 722 722 722 722 666 666 610 556 556 556 556 556 556 889 500 556 556 556 556 277 277 277 277 556 556 556 556 556 556 556 548 610 556 556 556 556 500 556 500 ]
endobj
 
 
(actually we now use MacRoman encoding as generally works better).
All the data there can be gatherted from the FreeType TTF font in Pharo. Just needs to be present on the end-user's pc.
A typical PDF reader will do fallbacks as necessary if not present.
(not tackled fully embedded fonts yet).

Regards, Gary
----- Original Message -----
Sent: Wednesday, June 19, 2013 6:42 AM
Subject: Re: [Pharo-dev] Barcodes

Hi Gary,

yes, I'm interested by help and pointers about TTF. It's a planned evolution of Artefact.

About barcodes generation, why don't use Artefact directly ?  You can draw barcodes with the PDFDraw elements (PDFLineElement, PDFRectElement, etc.) and print the document on stickers.  

In the future, it could be cool to have a Artefact-Elements-Barcodes package :)

Best regards
Olivier

Le 18 juin 2013 à 18:37, Gary Chambers a écrit :

Well, hoping to work with Torsten on barcodes in general, given we have support for canvas based drawing of a few formats here at Pinesoft.
 
Also, if Olivier would like some help with TTF in PDFs I can give some pointers etc.

Regards, Gary
----- Original Message -----
Sent: Tuesday, June 18, 2013 5:23 PM
Subject: Re: [Pharo-dev] Barcodes

You should be able to create a form, paint it white, draw on it with a barcode TTF font, export that form to JPEG, and then use that JPEG into Artefact.

Not really straight-forward, but it should work.

*Note: I've found that writing JPEG's in Pharo, it assumes that the background is BLACK if it isn't isn't specifically painted with something else first.  Unlike PNG and GIF, which assume WHITE.

-Chris


On Tue, Jun 18, 2013 at 1:44 AM, Olivier Auverlot <[hidden email]> wrote:
Hi Torsten,

Artefact don't support TTF fonts for the moment but it's planned in futures versions.

Best regards
Olivier :-)

Le 14 juin 2013 à 16:16, Milan Mimica a écrit :

You just need a TTF font. Does Artefact support TTF? hpdf does.


On 14 June 2013 13:58, Torsten Bergmann <[hidden email]> wrote:
Do we have some barcode stuff available for Pharo?
Something "Form" based that can be used with Artefact?

Thx
T.




-- 
Milan Mimica
http://sparklet.sf.net

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Olivier Auverlot
In reply to this post by Stephan Eggermont-3
Very cool !!!

Le 20 juin 2013 à 13:41, Stephan Eggermont a écrit :

> So, this kind-of works. Both Artefact and Barcode repositories are not writable,
> so here is an artefact package that depends on barcode.
>
>
>
> ean13Test: aStream
> "drawing an EAN13"
>
> | pdfdoc aPage barcode sequence |
> barcode := BarcodeEAN13 value: '2109876543210'.
> sequence := barcode binarySequence.
> pdfdoc := PDFDocument new.
> aPage := PDFPage new.
> sequence withIndexDo: [:each :index |
> each = $1 ifTrue: [
> aPage add: (PDFLineElement
> from: (20+index) pt @ 50 pt
> to: (20+index) pt @ 20 pt). ] ].
> pdfdoc add: aPage.
> pdfdoc styleSheet drawColor: (PDFColor r: 0 g: 0 b: 0).
> pdfdoc exportTo: aStream
>
>
> <Artefact-Barcodes.st><ean13Test.pdf>


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Guillaume Larcheveque
In reply to this post by Stephan Eggermont-3
Hello,

We just added Stephan and Torsten to Artefact contributors so they should be able to commit. Therefore we don't find the account of Gary Chambers on Smalltalk Hub. Do you have one?

Thanks in advance for your contribution to Artefact.


2013/6/20 Stephan Eggermont <[hidden email]>
So, this kind-of works. Both Artefact and Barcode repositories are not writable,
so here is an artefact package that depends on barcode.



ean13Test: aStream
        "drawing an EAN13"

        | pdfdoc aPage barcode sequence |
        barcode := BarcodeEAN13 value: '2109876543210'.
        sequence := barcode binarySequence.
        pdfdoc := PDFDocument new.
        aPage := PDFPage new.
        sequence withIndexDo: [:each :index |
                each = $1 ifTrue: [
                        aPage add: (PDFLineElement
                                from: (20+index) pt @ 50 pt
                                to: (20+index) pt @ 20 pt). ] ].
        pdfdoc add: aPage.
        pdfdoc styleSheet drawColor: (PDFColor r: 0 g: 0 b: 0).
pdfdoc exportTo: aStream





--
Guillaume Larcheveque

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Stephan Eggermont-3
In reply to this post by Torsten Bergmann
I've committed and merged.
That introduces a dependency on Barcode in Artefact.
Would you prefer:
- creating a separate package depending on both
- splitting artefact
- making Artefact depend on Barcode
- making the dependency the other direction
- reverting

Stephan

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Guillaume Larcheveque
I prefer the first one, creating a separate package depending on both.


2013/6/21 Stephan Eggermont <[hidden email]>
I've committed and merged.
That introduces a dependency on Barcode in Artefact.
Would you prefer:
- creating a separate package depending on both
- splitting artefact
- making Artefact depend on Barcode
- making the dependency the other direction
- reverting

Stephan




--
Guillaume Larcheveque

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Olivier Auverlot
me too :)

Le 21 juin 2013 à 16:39, Guillaume Larcheveque a écrit :

I prefer the first one, creating a separate package depending on both.


2013/6/21 Stephan Eggermont <[hidden email]>
I've committed and merged.
That introduces a dependency on Barcode in Artefact.
Would you prefer:
- creating a separate package depending on both
- splitting artefact
- making Artefact depend on Barcode
- making the dependency the other direction
- reverting

Stephan




--
Guillaume Larcheveque


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Stephan Eggermont-3
In reply to this post by Torsten Bergmann
Guillaume wrote:
> I prefer the first one, creating a separate package depending on both.

Done & merged.
Now there is an ArteBar package in Artefact.
Configuration not changed.

Stephan



Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Olivier Auverlot
Woohoo !

Le 22 juin 2013 à 01:05, Stephan Eggermont a écrit :

> Guillaume wrote:
>> I prefer the first one, creating a separate package depending on both.
>
> Done & merged.
> Now there is an ArteBar package in Artefact.
> Configuration not changed.
>
> Stephan
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

Guillaume Larcheveque
With Olivier we looked at Artebar and refactor it to use composite following the Artefact spirit.

Now it is completely reusable and you can use stylesheet, layout or anything you want on it.

Look at the tutorial in the Pharo Help Browser to know how to create a composite (it was not written when you have created your demo)


2013/6/22 Olivier Auverlot <[hidden email]>
Woohoo !

Le 22 juin 2013 à 01:05, Stephan Eggermont a écrit :

> Guillaume wrote:
>> I prefer the first one, creating a separate package depending on both.
>
> Done & merged.
> Now there is an ArteBar package in Artefact.
> Configuration not changed.
>
> Stephan
>
>
>





--
Guillaume Larcheveque

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Barcodes

cindy313
This post was updated on .
In reply to this post by Torsten Bergmann
CONTENTS DELETED
The author has deleted this message.
12