<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body>
    
<div>Thank you Brian. A lot of good methods to try.  Much appreciated. </div><div><br></div><div>Chris </div><div><br></div><div><br></div><div><br></div><div id="composer_signature"><div style="font-size:85%;color:#575757">Sent from my Verizon Wireless 4G LTE smartphone</div></div><br><br>-------- Original message --------<br>From: "Brian K. White via Filepro-list" <filepro-list@lists.celestial.com> <br>Date: 10/27/2015  10:41 PM  (GMT-05:00) <br>To: filepro-list@lists.celestial.com <br>Subject: Re: 3 of 9 Barcode <br><br>On 10/27/2015 3:56 PM, Chris S. via Filepro-list wrote:<br>><br>><br>> All,<br>> filePro 5.8Windows environment.<br>> This most likely has been addressed,  but I am looking for a way to embed barcodes directly into my reports.  I want to maybe use a downloadable software font to load onto an HP laser/desk jet printer if that is possible. I would like to be able to set it up in filePro's printer maintenance so that I can use a code in output to turn on/off barcode functions. Anyone know  of any that are free?<br>> Thank you in advance for any help this list can provide.<br>> Chris<br><br>That is doable exactly as you imagine. We've done it since decades ago.<br><br>There are also other approaches like post-processing the print file with <br>a gnu barcode program like foobar.<br> From foobar.c comments:<br>UNIX command line example to print a 3-of-9 barcode for "123AC":<br>echo "A pretty [FOOBAR;DATA=*123AC*] example" | foobar | lp -d myprinter<br><br>You can see that would be pretty easy to drop into an output form, but <br>them you just have to print to-file and post-processs the file, or maybe <br>make a separate printer definition in fp that pipes through foobar, or <br>add foobar to the printer interface script in the spooler... Lots of way <br>to skin the cat.<br>And actaully today there are much better utils that do everything all <br>kinds of codes including qr codes. This "foobar" is a tiny simple c <br>program from 1999. There is also gnu-barcode and Zint<br>http://directory.fsf.org/wiki/Barcode<br>http://sourceforge.net/projects/zint/?source=navbar<br><br><br>I also did it one time by using a postscript barcode program. There is a <br>gpl barcode program written entirely in postscript.<br>http://bwipp.terryburton.co.uk/<br><br>I don't remember why that was an advantage in that case, maybe because <br>it allowed positioning and sizing, or maybe because it handled some <br>special barcode format that nothing else did? I don't remember. But you <br>just include this blob of ps in your print job,<br>print plain text from filepro, no pcl codes!, and in the print job you <br>insert these commands to print whatever kind of barcode you need, size, <br>style, position, data, etc, and any postscript printer prints it. In <br>that case I actually ran the final postscript output through ghostscript <br>to output pcl on the server, and sent the pcl to the printers instead of <br>the ps, because although the printers could all print ps, it turned out <br>to be a lot faster to have the server convert the ps to pcl and send the <br>pcl to the printer, than to just send the ps to the printer.<br><br><br>Your first question, putting the pcl soft font into a print code and <br>printing pcl from filepro is the simplest, most bulletproof way, but <br>less flexible. You have to pick a particular font file that has the <br>right code, prints at the right size, includes or does not include the <br>human-readable characters. If you change any of those then you have to <br>change which font file to load. And if you're using an encoding that <br>requires checksum digits or other encoding, you have to do that yourself <br>in processing, whereas barcode generator programs usually do that kind <br>of stuff for you. And it's just pcl. You'd have to then run the pcl <br>through ghostpdl to get a pdf or some other kind of printer. (but then <br>again, ghostpdl exists, so you could)<br><br><br>You have to buy the fonts from someone. There are at least a couple <br>companies selling them. I have been using these forever:<br>http://www.barcodingfonts.com/barcode-pcl-fonts.htm<br>It includes directions for how to load the font to the printer from dos <br>or unix, how to include it in a print job, and how to use it in a print <br>job. It was a little complicated figuring out the pcl codes at first, <br>but the info was all there in the included help files.<br><br>More recently I found these, same idea:<br>http://www.morovia.com/<br>I am using micr fonts for checks from here, not barcodes, but they have <br>barcodes too.<br><br><br>The prices and the licensing obligations might just make it worth your <br>while to dig into the post-processing approach, since then the software <br>is all 100% gpl and it's legal to redistribute it without worrying about <br>violating any license.<br><br>But to use the font, you don't have to change your printer config or <br>spooler setup at all. You can do it all 100% from within filepro and an <br>ordinary output format.<br><br>You just make a print code that includes %"/path/to/font.pcl"<br>like:<br>611 ■ $1b *c31D %"/u/aljex/bc/BR360H62.USP" $1b *c31D $1b *c5F ■ install <br>bc31 3of9 36pt 6.2cpi hr   ■<br><br>This uploads the font file pro the printer, tells the printer to store <br>it as "font number 31". You stick that in the top-left corner of the <br>output format, or in the init code in the F8 options...<br><br>You know, I just found a whole notes file I had previously written up <br>just for this. This uses the Elfring fonts above. Here:<br><br><br>filepro-barcodes-pcl.txt<br>=============================================================================<br>=== Printing Bar Codes ===<br>This is a work in progress.<br>Step 5 should be able to be removed with some improvement to step 3.<br>More barcode fonts and documentation are in /u/aljex/bc/ .<br>brian@aljex.com<br><br>The overall process goes like this:<br><br>1) Figure out which barcode font you need.<br>2) Load the font into the printer once per print job.<br>3) Construct a dummy variable with the barcode data in processing.<br>4) Place the dummy on the output format.<br>5) Place some font fixup print codes immediately after the dummy.<br><br><br>How to do each of the above:<br><br>------------------------------------------------------------------------------<br>1) Figure out which font.<br><br>First you have to figure out which barcode font you will need, based on the<br>following properties:<br>    type of barcode: 3of9, 2of5, 2of5-interleaved, upc, postnet, ocr<br>    height: in points, 18pt, 36pt, 48pt, etc, 36pt = 1/2 inch<br>    width: in characters per inch, 4.6cpi, 6.2cpi, etc...<br>    human-readable: include regular characters also, or bare barcode.<br>    orientation: portrait or landscape<br><br>Right now every barcode font in the print code table is a portrait mode <br>version.<br>However we also have a landscape version of each one which we can add to the<br>table if needed.<br><br>Consult the comments in the hplaser.prt print code table starting at <br>code 601<br>to see which of the available barcode fonts most closely matches the<br>type/size/shape/variant you want.<br><br>Example: For code 3of9, 1/2 inch high, 6 characters per inch,<br>with human-readable characters included, portrait mode orientation,<br>That would be print code 611, which installs the font as font ID 31.<br>You need to remember the 31 later.<br><br>------------------------------------------------------------------------------<br>2) Install the font during job-init.<br><br>In the output format F8-Options init sequence, put the code for the normal<br>init sequence plus the code to install the barcode font(s).<br><br>Using the example above this would be: %3 %611<br><br>------------------------------------------------------------------------------<br>3) Assemble the barcode data in processing.<br><br>You can't have leading/trailing spaces in the barcode, so you need to <br>build a<br>string in a variable in processing that has the pcl code to select the <br>barcode<br>font, plus the data, plus the pcl code to switch back to a normal font.<br><br>The barcode data needs to be:<br>   select_bc_font { start_char { data { stop_char { select_normal_font<br><br>Since bar codes are large and odd-sized, it's easiest to deal with them like<br>graphics, where you save & restore the cursor position just before & <br>after the<br>image or in this case the bar code. And on your output format you place the<br>variable in the bottom-left corner of the space where the bar code <br>should go.<br>So you also want to add the push & pop pcl codes to above:<br><br>   push { bc_font { start { data { stop { normal_font { pop<br><br>The pcl code to select a font by ID is "Esc(##X"<br>The pcl code to select the standard font is "Esc(10U"<br>The pcl code to push (save cursore position) is "Esc&f0S"<br>The pcl code to pop (restore cursore position) is "Esc&f1S"<br>For 3of9 barcodes, the start and stop characters are both "*"<br><br>So the filepro processing to build the various pcl codes is:<br><br>   If: ' select font 31 (barcode) ; select standard font<br>Then: fb = chr("27"){"(31X"      ; fs = chr("27"){"(10U"<br>   If: ' pcl push            ; pcl pop<br>Then: pu = chr("27"){"&f0S" ; po = chr("27"){"&f1S"<br><br>Assuming you want the font above, and assuming the data is a pro number in<br>real field 26, then the filepro processing to build the entire string and<br>place it in variable BC would be:<br><br>   If:<br>Then: bc = pu { fb { "*" { 26 { "*" { fs { po<br><br>------------------------------------------------------------------------------<br>4) Place field *bc somewhere on your output format.<br><br>The barcode fonts are taller than normal , and the variable with the barcode<br>data includes cursor position save/restore codes.<br><br>So leave an empty rectangular space on the output format where the barcode<br>should go, and place the dummy variable *bc in the bottom-left corner of <br>that<br>rectangular area.<br><br>------------------------------------------------------------------------------<br>5) Add fix-up print codes immediately after *bc<br><br>To get the font back to the normal size after the barcode you may need to<br>insert print codes immediately after *bc. Print code 24 is already <br>inside the<br>variable bc, so not that one. But maybe 11, 15, and 30 or 31, or maybe <br>just 73.<br><br>------------------------------------------------------------------------------<br><br>==============================================================================<br>(end)<br><br>(code 73 in my hplaser.prt happens to be)<br>$1b (s0p10h0s0b4099T     ■ * courier 10 pitch<br><br><br>There you go! At least using the soft font method.<br><br>The postscript method and the post-processing method are two entirely <br>different emails!<br><br>-- <br>bkw<br><br><br>> Sent from my Verizon Wireless 4G LTE smartphone<br>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>> URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20151027/7d3f4b5d/attachment.html><br>> _______________________________________________<br>> Filepro-list mailing list<br>> Filepro-list@lists.celestial.com<br>> Subscribe/Unsubscribe/Subscription Changes<br>> http://mailman.celestial.com/mailman/listinfo/filepro-list<br>><br><br>_______________________________________________<br>Filepro-list mailing list<br>Filepro-list@lists.celestial.com<br>Subscribe/Unsubscribe/Subscription Changes<br>http://mailman.celestial.com/mailman/listinfo/filepro-list<br></body></html>