On 17.09.2004 21:08:30 Clay Leeds wrote: > 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).
No, you can't. The FOP extension doesn't have access to the page number ATM. > 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. I've tried both 3 of 9 fonts from [2] and [3] and the Code128 font from [2]. All work fine, although the TTF font causes two warnings because of missing TTF tables. > 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"> embed-file takes the PFB, not the PFM!!! The PFM is only for generating the font metrics XML. The PFB contains the actual font. It doesn't make a big difference but set kerning to "no". > <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> Works for me. > > 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. Dumb question: Have you supplied the userconfig.xml on the command-line? That's my only explanation for your problem. If I omit the userconfig.xml I get your error messages. Besides that I've done nothing special while generating the XML metrics. I've used practically the same configuration (including fontBaseDir). I've even copied snippets from your e-mail to reproduce the problems. Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]