You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Clute, Andrew" <AC...@iccohio.com> on 2001/11/05 16:52:48 UTC

Advice requested: Might have to extend FOP for Barcodes

All,

First some background on what I need to do: We generate forms that must have
a barcode on them so our sorteR machines can seperate them for mailings. If
a form has 7 pages on it, each page will have a barcode that says 1 of 7, 2
of 7, 3 of 7, etc. It actually looks like this (the barcode is encoded with
the following text):

0701
0702
0703

etc.

These barcodes are gif images that are placed using external-graphic, but
since the src property of extrnal-graphic cannot handle dynamic content, we
take an intermidete step that parses the fo doc and does string replacement
to place in the appropriate URI for that particular barcode image.

This worked fine when our forms where layed out in such a way that every
page-sequence tag generated one and only one physical page (I was using that
tag as my template match to place in the external-graphic). However, we now
have some forms that can be one page, but flow into two if the dynamic data
is larger than we thought, which means that the first page in the
page-sequence gets the barcode, but none of the other pages do! Poop!

So here is my proposed solution and I would like some feedback on it:

1) I am going to place a static-content element inside my page-sequence, to
make sure every physical page gets .....
2) A new FOP element, probably named barcode-external-graphic, that extends
external-graphic. This element will be responsible for, based on it's
attriburtes, creating the URI path to the gif file, and then calling
external-graphic to render the image with this new URI.

I know that this extends FOP, and that any future version I go to, I will
need to possibly modifiy this to work.

I would like feedback on the feasibilty of this, and if anyone else knows of
a different workaround for this situation.

Thanks in advance!

Re: Advice requested: Might have to extend FOP for Barcodes

Posted by Thomas Kübler <t....@update.de>.
Advice requested: Might have to extend FOP for BarcodesHallo,

i used the barcode lib from MSBBarCode.
This are java - libs and i have integrated this in a servlet. first i generated the individuell barcodes,
than i produce a produktion-xml-file and than the barcodes with fop. MSBBarcode generated jpeg-files.

http://www.java4less.com/

maybe it is the right think.

by thomas kübler

  ----- Original Message ----- 
  From: Clute, Andrew 
  To: 'fop-dev@xml.apache.org' 
  Sent: Monday, November 05, 2001 4:52 PM
  Subject: Advice requested: Might have to extend FOP for Barcodes


  All, 

  First some background on what I need to do: We generate forms that must have a barcode on them so our sorteR machines can seperate them for mailings. If a form has 7 pages on it, each page will have a barcode that says 1 of 7, 2 of 7, 3 of 7, etc. It actually looks like this (the barcode is encoded with the following text):

  0701 
  0702 
  0703 

  etc. 

  These barcodes are gif images that are placed using external-graphic, but since the src property of extrnal-graphic cannot handle dynamic content, we take an intermidete step that parses the fo doc and does string replacement to place in the appropriate URI for that particular barcode image.

  This worked fine when our forms where layed out in such a way that every page-sequence tag generated one and only one physical page (I was using that tag as my template match to place in the external-graphic). However, we now have some forms that can be one page, but flow into two if the dynamic data is larger than we thought, which means that the first page in the page-sequence gets the barcode, but none of the other pages do! Poop!

  So here is my proposed solution and I would like some feedback on it: 

  1) I am going to place a static-content element inside my page-sequence, to make sure every physical page gets ..... 
  2) A new FOP element, probably named barcode-external-graphic, that extends external-graphic. This element will be responsible for, based on it's attriburtes, creating the URI path to the gif file, and then calling external-graphic to render the image with this new URI.

  I know that this extends FOP, and that any future version I go to, I will need to possibly modifiy this to work. 

  I would like feedback on the feasibilty of this, and if anyone else knows of a different workaround for this situation. 

  Thanks in advance! 


RE: Advice requested: Might have to extend FOP for Barcodes

Posted by "Christopher R. Maden" <cr...@maden.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 10:06 5-11-2001, Tore Engvig wrote:
>There have been discussions about generation of barcodes earlier in this 
>list, I'm sure you find a solution if you search the archives.
>There exists quite a few barcode fonts, but most of them are broken (at 
>least from fop's viewpoint) the main problem for most of the fonts is that 
>they have no cmap.

Either I didn't fully understand the original question, or a lot of the 
respondents didn't.

The problem is that the barcode depends on the total number of 
pages.  Because FOP is loosely-coupled, that means that creating an SVG is 
impossible, because at the XSLT phase where that would happen, the total 
pages is completely unknown.

A bar-code font rendering of a page reference to the last page might do 
it.  See any of the past discussions of outputting "Page n of m", but 
change it to "mn" in a barcode font.

Neither SVG, nor a dynamic URL image inclusion, nor a change-and-replace on 
the FO files will do the trick here, I think.

~Chris
- -- 
Christopher R. Maden, Principal Consultant, HMM Consulting Int'l, Inc.
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: http://www.hmmci.com/ > <URL: http://crism.maden.org/consulting/ >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4  5DFC AC52 F825 AFEC 58DA
-----BEGIN PGP SIGNATURE-----
Version: PGP Personal Privacy 6.5.8

iQA/AwUBO+gmFqxS+CWv7FjaEQKehgCdFK4Mt3HvMHfBv1OOdBK/33XcPPoAoKf1
eyfrXmFt7FMfFXdsKcNBUNGY
=P0Vi
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


RE: Advice requested: Might have to extend FOP for Barcodes

Posted by Tore Engvig <te...@manamind.com>.
Advice requested: Might have to extend FOP for Barcodes
There have been discussions about generation of barcodes earlier in this
list, I'm sure you find a solution if you search the archives.
There exists quite a few barcode fonts, but most of them are broken (at
least from fop's viewpoint) the main problem for most of the fonts is that
they have no cmap. You can add the cmap yourself by using various font
tools, one tool is VOLT from Microsoft, available here:
http://www.microsoft.com/typography/developers/volt/default.htm?fname=%20&fs
ize=

Others have been succesful in generating barcodes by using svg.

Maybe someone who uses barcodes a lot could post a list of fonts that work
with fop and how to generate barcodes with svg, this should really go into
the FAQ.


Tore


  -----Original Message-----
  From: Clute, Andrew [mailto:AClute@iccohio.com]
  Sent: Monday, November 05, 2001 16:53
  To: 'fop-dev@xml.apache.org'
  Subject: Advice requested: Might have to extend FOP for Barcodes


  All,

  First some background on what I need to do: We generate forms that must
have a barcode on them so our sorteR machines can seperate them for
mailings. If a form has 7 pages on it, each page will have a barcode that
says 1 of 7, 2 of 7, 3 of 7, etc. It actually looks like this (the barcode
is encoded with the following text):

  0701
  0702
  0703

  etc.

  These barcodes are gif images that are placed using external-graphic, but
since the src property of extrnal-graphic cannot handle dynamic content, we
take an intermidete step that parses the fo doc and does string replacement
to place in the appropriate URI for that particular barcode image.

  This worked fine when our forms where layed out in such a way that every
page-sequence tag generated one and only one physical page (I was using that
tag as my template match to place in the external-graphic). However, we now
have some forms that can be one page, but flow into two if the dynamic data
is larger than we thought, which means that the first page in the
page-sequence gets the barcode, but none of the other pages do! Poop!

  So here is my proposed solution and I would like some feedback on it:

  1) I am going to place a static-content element inside my page-sequence,
to make sure every physical page gets .....
  2) A new FOP element, probably named barcode-external-graphic, that
extends external-graphic. This element will be responsible for, based on
it's attriburtes, creating the URI path to the gif file, and then calling
external-graphic to render the image with this new URI.

  I know that this extends FOP, and that any future version I go to, I will
need to possibly modifiy this to work.

  I would like feedback on the feasibilty of this, and if anyone else knows
of a different workaround for this situation.

  Thanks in advance!