I need to add a barcode to my fo:region-after. If this were a static barcode (i.e., one barcode per document), I would be just use Barcode4J[1]. But since part of the barcode indicates the current page number (d'oh!), I don't believe I can use Barcode4J for this purpose (Jeremias, please correct me if I'm wrong :-D). I believe this means I need to apply a barcode *font* to a <fo:page-number/> element. Unless there's a way to dynamically feed <fo:page-number/> to Barcode4J (which I don't think is possible), I think I'll have to use a font like this:

<fo:block font-family="barcode_font">F62P<fo:page-number/>-0704</fo:block>

(I have to admit, that I haven't tried with Barcode4J yet, but it's downloading now!)

On the FONT front, was anyone successfully used barcode fonts with FOP? Where can I obtain barcode fonts? I found a link[2] and I'll try some of the files there.

UPDATE: I've been trying, but I'm getting errors ('[ERROR] unknown font Code128JK_A,normal,normal so defaulted font to any' or '[ERROR] unknown font FREE3OF9,normal,normal so defaulted font to any', depending on the FONT I'm trying to use). I downloaded a barcode font from here[3], and followed the instructions on the FOP Font Page[4].

Here's the relevant portion of my conf/userconfig.xml file:

<entry>
  <key>fontBaseDir</key>
  <value>/Users/Shared/_WebDLs/barcode_fonts</value>
</entry>

<fonts>
<!-- snipped commented section(s) -->
<font metrics-file="A8______.XML" embed-file="barfonts/pfb/A8______.pfm" kerning="yes">
<font-triplet name="Code128JK_A" style="normal" weight="normal"/>
</font>
<font metrics-file="FREE3OF9.XML" embed-file="free3of9/FREE3OF9.TTF" kerning="yes">
<font-triplet name="FREE3OF9" style="normal" weight="normal"/>
</font>
</fonts>


This is the relevant XSL-FO for using the PFM:

<fo:block font-family="Code128JK_A">F62P<fo:page-number/>-0704</fo:block>

Since I was having trouble using the PostScript font, I tried using TTF. This is the relevant XSL-FO for using the TTF:

<fo:block font-family="FREE3OF9">F62P<fo:page-number/>-0704</fo:block>

Please let me know if I need to provide any other info.

Web Maestro Clay

[1] Barcode4J
http://barcode4j.krysalis.org/

[2] GPL Barcode fonts
http://user.it.uu.se/~jan/barfonts/

[3] Free 3of9 Barcode font
http://www.squaregear.net/fonts/free3of9.shtml

[4] FOP Fonts Page
http://xml.apache.org/fop/fonts.html


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



Reply via email to