Re: Barcodes in FO output using a font
On Sep 17, 2004, at 12:57 PM, Jeremias Maerki wrote: On 17.09.2004 21:08:30 Clay Leeds wrote: 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. Works for me now, see below... 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: fontBaseDir /Users/Shared/_WebDLs/barcode_fonts embed-file takes the PFB, not the PFM!!! The PFM is only for generating the font metrics XML. The PFB contains the actual font. Thanks! I didn't know which part I needed to include there. Now that I look back at the Fonts page, there is an example which has .pfb. Sorry. It doesn't make a big difference but set kerning to "no". Done! kerning="yes"> This is the relevant XSL-FO for using the PFM: F62P-0704 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: F62P-0704 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 That was the culprit, so I guess it wasn't a dumb question. It was me being dumb not including the config file. My only 'excuse' is to say that I've never had to use a config file before now (although I'll be using it in the future to play with strokeSVGText...) Thanks Jeremias! Web Maestro Clay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Barcodes in FO output using a font
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 element. Unless > there's a way to dynamically feed to Barcode4J (which > I don't think is possible), I think I'll have to use a font like this: > > font-family="barcode_font">F62P-0704 > > (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: > > >fontBaseDir >/Users/Shared/_WebDLs/barcode_fonts > > > > >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". > > >kerning="yes"> > > > > > This is the relevant XSL-FO for using the PFM: > > font-family="Code128JK_A">F62P-0704 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: > > F62P-0704 > > 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]
Re: barcodes
> According to [EMAIL PROTECTED] on Mon, Jun 17, 2002 at > 11:03:19PM +0200: >> Hi, >> >> I am using IdAutomation API (There also exists JBarCodeBean) in order >> to produce (code128) barcode images (either as GIF or JPEG format). >> The API > > > I propose you use something like the perl module Code128.pm for > the algorithm and then from the generated numbers it is real easy > to generate svg or fo for the bar code itself. > > If you need help you may let me know off list. > > -- > Eric Smith Hi, In fact, I have just found a font and the corresponding algorithm coded in Java on http://www.bizfonts.com. So i am now trying to incorporate the demo font they provide into FOP but I get the following exception trace when I use fop's TTFReader class in order to generate the font metrics file: C:\software\fop>c:\software\jdk131\bin\java -cp .\build\fop.jar;.\lib\batik.jar;.\lib\xalan-2.0.0.jar;.\lib\xerces-1.2.3.jar;.\lib\avalon-framework-4.0.jar;lib\logkit-1.0.jar;.\lib\jimi-1.0.jar org.apache.fop.fonts.apps.TTFReader -enc ansiC:\WINNT\fonts\SadC128b.ttf barcodettfcm.xml TTF Reader v1.1.1 Reading C:\WINNT\fonts\SadC128b.ttf... Number of glyphs in font: 134 Unicode cmap table not present java.util.NoSuchElementException: Vector Enumeration at java.util.Vector$1.nextElement(Vector.java:288) at org.apache.fop.fonts.TTFFile.createCMaps(TTFFile.java:398) at org.apache.fop.fonts.TTFFile.readFont(TTFFile.java:387) at org.apache.fop.fonts.apps.TTFReader.loadTTF(TTFReader.java:181) at org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:143) which has me thinking that the font does not support unicode ? It is trying to create a character map for unicode I believe ! Anyone has an idea ? Pascal.
Re: barcodes
According to [EMAIL PROTECTED] on Mon, Jun 17, 2002 at 11:03:19PM +0200: > Hi, > > I am using IdAutomation API (There also exists JBarCodeBean) in order to > produce (code128) barcode images (either as GIF or JPEG format). The API I propose you use something like the perl module Code128.pm for the algorithm and then from the generated numbers it is real easy to generate svg or fo for the bar code itself. If you need help you may let me know off list. -- Eric Smith
re: barcodes
Hi, I am using IdAutomation API (There also exists JBarCodeBean) in order to produce (code128) barcode images (either as GIF or JPEG format). The API is very easy to use. I use an fo:external-graphic tag to integrate them. On the other hand, the barcode reader I use has some difficulty to read them. It reads them ok but it seems that the generated images are of average quality and it takes the barcode reader a long time to read them. Another issue is that it is not easy to produce a image fitting a given size. You will have to play with multiples of the printer resolution. In fact, I generate big images in order to keep the quality acceptable. Apparently, the use of fonts makes better quality barcodes (They used that with the application that we are trying to replace). I have not investigated fonts as I was too short on time and the image based solution seems to be accepted (at least as of now, but that may change). I have been told that a specific algorithm is needed in order to encode the barcode value into a string of characters (that will be used for input to the font and FOP). Another reason for which I did not use this type of solution is that this algorithm is contained within a DLL and we do not want to go playing with DLLs (We are using a Java Application Server and it is not recommended to use DLLs in an AppServer). If you try fonts, let me know. I may also have a go on them if I have the time for it and/or if the guys here tell me that the barcode quality is judged unacceptable (too slow to read). Hope I gave few some good feedback. Pascal