Re: [dev] datamatrix 2d barcodes for Calc

2007-02-13 Thread Alessandro Zummo
On Tue, 13 Feb 2007 13:47:46 +0100
Christian Lohmaier <[EMAIL PROTECTED]> wrote:

> > 
> >  a) cell changes
> >  b) read it, generate barcode, save barcode to file
> >  c) load file and embed image
> 
> Yes, how else should it work?
> 
> What intervals are you talking about? How often does it have to be
> regenerated?

 each time the cell changes. it depends on the user. a barcode
 can hold any kind of data.. for example, the result of a sum
 of a column.

> How did you envision how things should work?

 I would have used graphics primitives to draw
 the object in memory.

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] datamatrix 2d barcodes for Calc

2007-02-13 Thread Christian Lohmaier
On Tue, Feb 13, 2007 at 11:15:36AM +0100, Alessandro Zummo wrote:
> On Tue, 13 Feb 2007 11:00:04 +0100
> Christian Lohmaier <[EMAIL PROTECTED]> wrote:
> > 
> > If you need to update the barcode, you just delete the old one and embed
> > the new one...
> 
>  the new one must be dynamically generated based on the
>  content of a cell. you are suggesting something like that:
> 
>  a) cell changes
>  b) read it, generate barcode, save barcode to file
>  c) load file and embed image

Yes, how else should it work?

What intervals are you talking about? How often does it have to be
regenerated?

How did you envision how things should work?

ciao
Christian
-- 
NP: nichts

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] datamatrix 2d barcodes for Calc

2007-02-13 Thread Christian Lohmaier
On Sun, Feb 11, 2007 at 03:01:02PM +0100, Alessandro Zummo wrote:
> On Sun, 11 Feb 2007 14:44:09 +0100
> Christian Lohmaier <[EMAIL PROTECTED]> wrote:
> 
> > >  I guess this would work, but would also require having a web server
> > >  to generate the image. looks ugly ;(
> > 
> > I think you misunderstool the URL-part. That doesn't mean that you need
> > a webserver. OOo uses URLs for "everything", a local file is
> > file:///tmp/somedir/some.file on linux for example (or
> > file:///c:/tmp/somfile.txt on windows)
> 
>  ok, but the barcode is supposed to change
>  based on the contents of a cell, how can
>  you do that with a file based image?

Huh? What other images are there than "file based" ones?
 
>  If you use a webserver you can maybe add
>  the code to the url and have a cgi generate
>  it, but you can't with a file url.

You still didn't understand what the codesnippets does.
It uses a temporary file and inserts it into the document, so that you
can remove the temporary file afterwards.
Even for internal (embedded) images, there are URLs (special ones that
point into the document-container).

If you need to update the barcode, you just delete the old one and embed
the new one...

ciao
Christian
-- 
NP: nichts

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] datamatrix 2d barcodes for Calc

2007-02-12 Thread Alessandro Zummo
On Sun, 11 Feb 2007 14:44:09 +0100
Christian Lohmaier <[EMAIL PROTECTED]> wrote:

> >  I guess this would work, but would also require having a web server
> >  to generate the image. looks ugly ;(
> 
> I think you misunderstool the URL-part. That doesn't mean that you need
> a webserver. OOo uses URLs for "everything", a local file is
> file:///tmp/somedir/some.file on linux for example (or
> file:///c:/tmp/somfile.txt on windows)

 ok, but the barcode is supposed to change
 based on the contents of a cell, how can
 you do that with a file based image?

 If you use a webserver you can maybe add
 the code to the url and have a cgi generate
 it, but you can't with a file url.


-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] datamatrix 2d barcodes for Calc

2007-02-11 Thread Christian Lohmaier
Hi Alessandro, *,

On Sun, Feb 11, 2007 at 02:17:23PM +0100, Alessandro Zummo wrote:
> On Sat, 10 Feb 2007 09:55:03 +0100
> Christian Lohmaier <[EMAIL PROTECTED]> wrote:
> [...]
> > Basically the tough thing is embedding the generated graphic into the
> > document.
> 
>  yep, I noticed that ;) 
> 
> > I was having trouble with this as well, but got around it using an idea
> > from Danny Brewer (using the BitmapTable to get the graphic into the
> > container):
> > http://codesnippets.services.openoffice.org/Writer/Writer.EmbedAGraphicIntoATextdocument.snip
> 
>  I guess this would work, but would also require having a web server
>  to generate the image. looks ugly ;(

I think you misunderstool the URL-part. That doesn't mean that you need
a webserver. OOo uses URLs for "everything", a local file is
file:///tmp/somedir/some.file on linux for example (or
file:///c:/tmp/somfile.txt on windows)

THe routine I wrote expects a OOo-suitable URL for convenience. Java's
file-routines give you a "file:/tmp/foo.bar" only when you query for the
name in URL-notation.
The Graphic-Info property I used in the snippet looks like this:
(note that I use double here instead of the int OOo expects, it is just
convenience since barcode4j uses double)

private static class GraphicInfo {
/**
 * a UNO-style URL to the graphic (file:///tmp/path/foo.ext)
 */
String unoURL;
/**
 * the height of the graphic in 1/100 mm
 */
double heightOfGraphic;
/**
 *  the width of the graphic in 1/100 mm
 */
double widthOfGraphic;
}


You can use the ExternalUriReferenceTranslator service to convert an "external"
file-URL to an internal one (the file:///dir/otherdir/file.ext) notation:

file:///opt/openoffice.org2.1_sdk/docs/common/ref/com/sun/star/uri/ExternalUriReferenceTranslator.html
http://api.openoffice.org/docs/common/ref/com/sun/star/uri/ExternalUriReferenceTranslator.html

So when you read "URL", that doesn't imply "web/internet" :-)

ciao
Christian
-- 
NP: Samael - To Our Martyrs

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] datamatrix 2d barcodes for Calc

2007-02-10 Thread Christian Lohmaier
Hi Alessandro, On Sat, Feb 10, 2007 at 01:51:17AM +0100, Alessandro Zummo wrote:
> [...]
>I'm planning to write a plugin for Calc to draw
>   DataMatrix 2D barcodes.

If you don't have the logic already to actually generate that barcode, I
suggest to have a look at the barcode4j project.
http://barcode4j.sourceforge.net/
It is under Apache License v2

>I'm new in writing plugins, so I would like
>  to ask if someone can help in dealing with the
>  interfacing with OO while I can write the barcode
>  handling code.

See above. You don't need to reinvent the whell :-)
Basically the tough thing is embedding the generated graphic into the
document.
I was having trouble with this as well, but got around it using an idea
from Danny Brewer (using the BitmapTable to get the graphic into the
container):
http://codesnippets.services.openoffice.org/Writer/Writer.EmbedAGraphicIntoATextdocument.snip

>If things goes well, support for other
>  1D and 2D barcode symbologies will be added.

Others were faster :-)) (but maybe you could do the same in another
programming language)

ciao
Christian
-- 
NP: Bif Naked - Any Day Now

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[dev] datamatrix 2d barcodes for Calc

2007-02-09 Thread Alessandro Zummo

 Hello,

   I'm planning to write a plugin for Calc to draw
  DataMatrix 2D barcodes.

   I'm new in writing plugins, so I would like
 to ask if someone can help in dealing with the
 interfacing with OO while I can write the barcode
 handling code.

   If things goes well, support for other
 1D and 2D barcode symbologies will be added.

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]