This file contains information about: PRINT : LaserJet-Specific Tips ******** THREADS2.DBF, 2.0 BETA MESSAGES ******** Msg#: 29817 Date: 02-Jul-91 Fm: Y. Alan Griver 71541,3150 To: Craig Church 72030,1627 (X) You can store a laserjet macro in a memo field and just send that to the laserjet, then print your form data on top of it. Menachem did a wonderful session at dbExpo on this - he added a few tricks. He broke down typical forms into different components - logo, letterhead, verbiage for the bottom of forms, and kept them each in their own record. He then had a dbf with "english" names for the form - for instance, "Invoice" would contain the logo and the verbiage. Using the record number for the "Invoice", he could ensure that the HP Macro numbers were always unique, and still assemble his pages piece by piece... yag Msg#: 29845 Date: 02-Jul-91 Fm: Y. Alan Griver 71541,3150 To: Craig Church 72030,1627 (X) I'm sorry - I didn't explain it well. You have a few related databases: Macro - Contains the name of the full object (IOW: Invoice) Sections - Contain *parts* of a full object (IOW: Logo, Verbiage) Connection - Contains the link between "Macro" and "Sections" IOW: Macro Section ----- ------- Invoice Logo Invoice Verbiage So, you pick *one* record from Macro for what you want printed. *That* assigns the macro number. You then look in the "Connection" database to see what parts should be combined to form that Macro. Finally, you combine them from the "Sections" database... Okay? yag Msg#: 24448 Date: 11-Jun-91 Fm: John Miles 75600,136 To: Holly Anne Covell 73750,74 (X) Holly, One way to do graphics (if they are going to be printed at the top of the page) is to do the following: 1. Get the logo into a .PCX file ( or graphics file compatible with you word processor). 2. Print the logo from your word processor in the correct scale and aspect to a file (I use a .PRN extension). 3. Edit the .PRN file in a text editor to remove the page eject control code at the end of the file. FoxPro's editor is quite good for this as it does not add any EOF marks like Norton's editor does. 4. When you want to print the graphic in FP, simply issue: !TYPE LOGO.PRN >LPT1: or !COPY LOGO.PRN LPT1: /b (/b cause the a binary copy which prevents confusion with the control codes) This will work pretty well. Would be nice though, if some developer would write an API application for this! Any takers out there??? One word of caution about the above approach: a network capture command may time out when doing this, so you may have to play with timeouts and autoendcap settings. John Msg#: 25637 Date: 16-Jun-91 Fm: R. Kfoury 70274,2676 To: John Miles 75600,136 John Miles is on the right track but there is one more this to do. HP laserjets have a feature called MACROS. What this will allow to do is download a print image like a form or a logo to the printer memory that will be overlayed on top of any other output you send to the printer. This works great since the overlay can be stored in the printer's memory so you don't have to download it every time. Any graphics program can be used with this approach. Just remember to send the output which will be in PCL format to a file and remove the form feed character. Look up macros in the Laserjet manual. Ron K4E ******** THD201.DBF ******** Msg#: 122591 Date: 25-Jul-91 Fm: tom meeks 70304,2176 To: Jim Adams 72470,3603 (X) There are several programs that can be used to turn the 'graphics' logo into an HP font... a large 1 character font. Provided the graphics format is a bitmap or can be converted to bitmap. The best of the programs are windows apps. Once this has been done the 'font' is loaded like any other softfont and the logo is treated as the letter 'A' or whatever you've chosen as the character. Another way is the use the word processing program that the client now uses to send the logo to the printer and redirect its output to a file. Word Perfect *will* do this. The resulting file will contain all the setup and graphics codes for printing the logo (since the program thinks it *is* printing the logo.) Later the file may simply be 'copied' to the printer to create the logo.... ! copy logofile.doc prn: You might actually be able to store the file in a memo field and print the field to build the logo. Again, the *logo* file won't work...a file containing the output meant for the printer probably will! You *may* have to use Norton's to remove the Form Feed character from the file first... unless you can control this from the word processing program. (No page eject after printing) You can test this outside of FoxPro. Notice the vast difference between the size of the native logo file (small) and the generated logo printer file. (large) The difference is that the printer file carries all the format info. Tom Msg#: 142066 Date: 01-Sep-91 Fm: Glenn Hart 76703,4226 To: Martin Schiff [CONSULT] 76702,1355 (X) I've done that too, although there's a trivial little program that's been floating around for years named LASER66.COM that does it too without worrying about the PCL codes. Anyway, I noticed that the newest version of P_CODES contains *two* entries for the LaserJet, one with the 7.27 for 66 lines per page and another with 8 for 60 lines per page. Choose your poison. Glenn Msg#: 37848 Date: 20-Aug-91 Fm: Menachem Bazian 76366,42 To: Andy Griebel 71441,3452 (X) Andy, The trick is very simple. All you have to do, before sending the graphic to the printer, is tell it that the graphic is not *PRINT* data but rather *MACRO* data. Basically, here is the sequence... lcMacroId = '1' && I am arbitrarily setting the macro number. && It can be anywhere from 1 - about 32000 && (or some such high number) ??? CHR(27)+'&f'+lcMacroId+'Y' && Identify the macro you are working with ??? CHR(27)+'&f0X' && Start Macro Definition Command. This && The HP that what it is getting is to be && store as macro # lcMacroId. *** NOW SEND THE GRAPHIC, FORM OR WHATEVER TO THE PRINTER ??? CHR(27)+'&f1X' && Stop Macro ??? CHR(27)+'&f10X' && Make the macro permanent -- Not && necessary but I prefer to do this way && for a couple of reasons... To USE the macro, send the following string... ??? CHR(27)+'&f'+lcMacroId+'Y' && Identify the macro you are working with ??? CHR(27)+'&f2X' && Execute the MACRO To delete the macros, you have the choice of three escape sequences. CHR(27)+'&f6X' && Delete ALL Macros CHR(27)+'&f7X' && Delete ALL Temporary Macros CHR(27)+'&f8X' && Delete the last macro ID I specified with the '&f#Y' && sequence. That's basically it. I prefer to D/L my macros as permanent so I don't have to worry about a printer reset getting rid of them. Also, in an MU situation, I think its safer. I can always delete them individually or clear the memory if I want. That's personal preference, though. Menachem ******** THD202.DBF ******** Msg#: 153470 Date: 25-Sep-91 Fm: Doug Dodge 70153,1772 To: Chaim Caron 72520,2272 (X) Chaim, I'm doing this from a rusty memory but here goes.. If you do a font printout on your laserjet, there will be some sort of identifier associated with each font. If I remember correctly, you can use the HP language set and insert that font identifier (along with the appropriate point size, weight, etc) in an escape sequence. Then, all you need to do is ??? . The actual escape sequences you need to use should be in the HP manual. It's kind of like tinker-toys, you take the various escape sequences for each part of the font you want and put them together... Sorry I don't have the _actual_ codes for you. I just moved and I haven't had a chance to unpack yet.. Regards, DD Msg#: 154390 Date: 27-Sep-91 Fm: Mid-Mountain Data Systms 70640,716 To: all I'm gonna hit somebody! Here's the problem... I have a client who is using SBT's dProfessional Time and Billing accounting package (which is written in FoxBase). It is being run on an 80386sx/16mHz. Output to the printer is through COM1: set at 9600,N,8,1,p. All PRN output has been redirected to COM1: The printjobs are being sent (via COM1:) to an HP LaserFAX which is then connected via parallel cable to an HP LaserJet III. When trying to print out statements (or any other report function), it goes through about 3-5 pages, then stops and says OUT OF PAPER ERROR. Upon calling SBT about this, they said that the problem was within FoxBase, not their program. Since my client does not have source code for this program, is there anything in the configuration of FOXBASE that I could do externally to SBT's program to eliminate this problem? I might also add that when the computer is hooked up via parallel cable to the LaserFAX/LaserJet combo, all works fine. H E L P ! Msg#: 154875 Date: 28-Sep-91 Fm: Glenn Hart 76703,4226 To: Mid-Mountain Data Systms 70640,716 Dear Mid-Mountain, First some housekeeping. Please use the OPTions;NAMe command at any forum prompt to provide you complete first and last name. Company names are not allowed, and we all like to know who we're talking with. Thanks. The problem is neither Fox's nor SBT's. Your printer's serial handshaking or cable is wrong. What's happening is that you're overrunning the printer's buffer. This is one of the annoying aspects of serial printing that we all had to contend with years ago that's receded as most people use the easier and less complicated parallel connection method. Short of using a serial breakout box, which you may not own and which requires some experience to interpret, I'd suggest checking the manuals for the HP LaserFax and LaserJet to check whether XON/XOFF handshaking is enabled, whether hardware handshaking (much better) is set, and/or replacing the cables with official HP models. If you need further support, it's Hewlett-Packard you need to deal with, since this has nothing to do with either the Fox or SBT software. Good luck, and I'm sure rectifying the handshaking situation will set things straight for you. GLenn Msg#: 154265 Date: 27-Sep-91 Fm: Lisa Slater 72077,2417 To: Mike Reed 76266,3724 (X) Mike, Depending on whether or not you have patched your printer driver files, you either have one or two HP LJ entries in your P_codes.dbf. If your copy of the file is late enough, you have a second one with (60 lpp) in the printer name. This one is good for labels, it is the default HP line spacing. The other is provided to make it possible for people to get 66 lpp on an LJ so they can design one report form for dot matrix and laser printers. If you don't have this second entry, you can make it. USE P_codes and find the HP entry. SCATTER MEMVAR, APPEND BLANK, GATHER MEMVAR. Now change the name of this entry to indicate 60 lpp or something. Then change the escape codes in the P_6lpi field; change the 7.27 to 8 and you're almost in business, one last step: rebuild GENPD.APP, because this dbf is *included* in it and your changes need to be incorporated. >L< Msg#: 154625 Date: 27-Sep-91 Fm: Mike Reed 76266,3724 To: Lisa Slater 72077,2417 Lisa, After examining the 2 LJET entries in P_CODES I now see the problem: The original LJET entry had P_6LPI & P_8LPI values that would yield 66 and 88 lines per page (lpp). As you said, this was done to make LJETs able to hold the same # of lpp as dot matrix printers using 6 or 8 lpi. In reality, this printer entry yields 6.6 and 8.8 lpi when output to a LJET. The newest LJET entry "HP LJ II (60 lpp)" changed the P_6LPI to yield a true 6 lpi printout, resulting in a 60 lpp limit (6 lpi x 10"). HOWEVER, whoever made this new entry forgot to also change the P_8LPI value so true 8 lpi and 80 lpp printing would result. I beleive a lot of people are going to need true 6 AND *8* lpi capabilities, since many preprinted forms and labels have print/spacing requirements of exactly 1/6 or 1/8 inch per line. In my case I have 8.5 x 11" laser label sheets with 9 labels arranged 3 x 3 with .25" spacing between rows. This necessitates true 8 lpi printing to deal with the .25" spacing. Anyone interested in correcting the newest "HP LJ II (60 lpp)" P_CODES entry for true 8 lpi (when the 8 lpi button is checked), should change the value in P_8LPI from 5.45 to 6. Mike ******** THD204.DBF ******** Msg#: 185226 Date: 02-Dec-91 Fm: Steven Black 76200,2110 To: Mike Campos 72317,3576 (X) Mike, here is what works for me. All this assumes a laser printer. * Intercept a blank form, before it prints, with PCMag's LPT2DSK program. * Use Norton's Utilities to edit out, from the resultant Printer.Out file, any form-feed characters that may be therein. There may be several. * Fill a blank form with a printed grid to get a feel for the coordinates of the boxes & slots where info goes. * Get your hands on ATSAY.PRG featured in September 24th 1991 PC Magazine. This will allow you to print to a laserjet by using any font, in any order (no automatic eject worries). * design your program to fill in the form. * The first thing your form filling program should do is... ! Copy/b MyForm.xxx Lpt1: > Nul ..assuming that you renamed the un-form-fed Printer.out file to MyForm.xxx. That lays down the blank form onto a blank page. Now, fill in the blanks, Eject, and bob's 'yer uncle. **--** Steve ******** THD205.DBF ******** Msg#: 202002 Date: 10-Jan-92 Fm: tom meeks 70304,2176 To: STEVE LONG 70322,2055 I use a system variable that is reset each new day to check for the presence of softfonts. If the variable is .T. I ask if the user wants to download (in case the fonts were changed by another program, etc) If the variable is F., I go ahead and download... assuming that it's the beginning of a new day. To my knowledge, there is no feedback from the HP to indicate to the computer that a given font exists. tom Msg#: 197743 Date: 01-Jan-92 Fm: Guerri F. Stevens (WPSG) 76702,1070 To: Lisa Slater 72077,2417 (X) Ok, first the answer to the most burning question of the day: "what am I". I am a woman. Blaise was right. Now: I ran your experiment exactly as you stated it, in spite of my not understanding one of your commands, but more about that later . Here is what my laser, an HP LJ Series II, gave me: ONEFIELD OTHERFIELD 1 This is a testThis is a testThis is a testThis is a testThis is a test What I didn't understand in your example was "create cursor guerri". I expected a file name following the "create". What is the term "cursor"? I have only the Commands and Functions manual with me at the moment, and don't see that term there. In deference to Blaise who is encouraging me to use the online help, I tried "help cursor" but it pointed me to CURDIR() which was not helpful. I tried "help create" and just got the basic help for the create command. At times I think I am not using the same version of FP as the rest of you . I have experimented further. I think that both you and Blaise may be right. Blaise and I believe that the output from DISPLAY TO PRINT is determined in part by the printer itself. I issued the HP LJ command "&s0C" to the printer and after doing so, my DISPLAY wrapped!. I also think, as you do, that the printer driver does affect the format, since my experiment yesterday with my dot matrix at work did change when I installed a driver. What I don't know is how to modify the driver to make the lines wrap. Msg#: 207456 Date: 22-Jan-92 Fm: tom meeks 70304,2176 To: Greg Alter 70412,2041 Thanks for your 'Thanks' and kind words. Your response sparked an idea that may be useful to everyone that works with laser output. The key to using the line\box\greybar functions in the HP printer control language is simple measurement in inches. So a set of functions that relieves the programmer of the tedium of programming the command string may prove very useful. The functions would take the values in inches and build up the lines and bars thusly: =HP_GREYBAR(y_center,x_center,y_size,x_size) [=HP_GREYBAR(1.5,4,2,6)] =HP_BOX(y_center,x_center,y_size,x_size) I've can justify a bit of work on them since I could certainly use them also... what do you think? Tom Msg#: 206030 Date: 19-Jan-92 Fm: tom meeks 70304,2176 To: Norm Witte 72411,2337 <<@ SAY... for graphs>> There are several ways to handle text or graphics placement on a laser printer. However, you still cannot send a smaller 'Y' value in a series of @ SAY commands or you will still get forced form feeds. @ 10,10 SAY 'Line 10' @ 03,10 SAY 'Line 3' Will trigger a form feed on a laser as well as a dot matrix because the xbase language is looking for a smaller 'Y' value to tell it to start a new page. However, you can sit on a 'Y' value forever if you want to... and send the HP PCL command for positioning the cursor. Thus.... (PCL rows & columns) FOR y_line = 20 to 3 STEP -1 @ 00,00 SAY CHR(27)+'&a'+STR(y_line,3)+'r0C'+'Line No. '+STR(y_line) ENDFOR will print _up_ the page from line 20 to line 0. As far as FoxPro is concerned you have never left line 0; thus, no form feed! Drawing graphs is almost as simple. Changing the print line to: (PCL dots) @ 00,00 SAY CHR(27)+'&p'+STR(y_line,3)+'y'+STR(y_line,3)+'X'+box_code would draw a slanted line (box_code would contain the commands to draw a dot or small box depending on the thickness of the line.) Msg#: 206098 Date: 19-Jan-92 Fm: tom meeks 70304,2176 To: Norm Witte 72411,2337 I noticed that I had failed to change the '&' to a '*' in the line that demonstrated the change from a row\column orientation to a dot per inch format. It should read: @ 00,00 SAY CHR(27)+'*p'+STR(y_line,3)+'y'+STR(y_line,3)+'X'+box_code A small difference... with big consequences. While I'm at it, the box_code for a 10x10 dot solid box would be: box_code = CHR(27)+'*c10a10b0P' Tom ******** THD206.DBF ******** Msg#: 213516 Date: 04-Feb-92 Fm: tom meeks 70304,2176 To: Joe Bigelow 76066,1611 Joe, In case John isn't able to get right back, I'll jump in if you don't mind. Every font downloaded to a laser printer is put in an area much like the select command so... CHR(27)+'*c1D' would indicate that you are defining font number 1. Now, I notice that John is using a 12 character field for font_id so he may do something more than this... like define if it is going to be the primary font. However, the string above is generally sufficient. You send the font to the printer immediately after defining the area. The next font would be preceeded by CHR(27)+'*c2D' and so on.... To get the font into the memo field you can use the APPEND MEMO command. Due to the nature of the memo fields I prefer to put things like this into new records... and only once. Otherwise, to be safe, include the OVERWRITE clause. APPEND MEMO fontfile.fonts FROM \fonts\lg095r.usp OVERWRITE Tom Msg#: 213796 Date: 05-Feb-92 Fm: John Fitzsimmons 71041,3003 To: Joe Bigelow 76066,1611 Joe - Yes, in my case the "font ID" is the name of the font file (e.g., HV060RPN.USP) but does not have to be. The syntax for getting the contents of the font file into a memo field is APPEND MEMO S_FONTS.FONT FROM . Quite easy. John ******** THD07.DBF ******** Msg#: 243541 Date: 05-Apr-92 Fm: Bill Chess 72446,2273 To: Lisa Slater 72077,2417 I also use an HPIIIp but I want complete control of the printer. I wrote a set of routines which use ??? (send to printer command). I then tell the printer in micro dots (300x300 per inch) exactly where I want the printing to go. Then proportional fonts go exactly where I want them to go. It also helps to have a ruler graduated in 30ths of an inch when designing the form. It really makes for precise and beautiful forms. I built routines to switch fonts, place the beginning of a printed string, specify type sizes, calculate row spacing etc. Then I'm not dependent upon what some printer driver designer thinks I want. The HP tech manual is great for figuring it all out. Good luck in any case, Bill Msg#: 229889 Date: 09-Mar-92 Fm: George Denniston 74730,3546 To: Dave Watkins Fox 76004,2575 Hi Dave, I have a two year old system written with 1.02 installed on a network at a customer site that creates a report to HP LJ II with condensed print output the following way: REPORT FORM filename.frx TO FILE C:\data\foxpro\filename.txt NOCONSOLE (Case Printer=LaserJet) p_17cpi = CHR(27)+CHR(38)+CHR(107)+CHR(50)+CHR(83) ??? p_17cpi COPY FILE filename.txt TO LPT1 All network printing is handled by Intel's LanSpool, and LPT1 output is captured and sent to network print queues. The customer has specificied that they would like the portrait condensed codes sent to the printer AT THE BEGINNING of the filename.txt using the following codes that they commonly use in other of their inhouse programs: &l0O (10U (s0p16.66h8.5v0s0b0T &l0P &l6D &s0C How can I include this or any other ascii printer control string at the top of the report form to file output? I have tried combining the printer control string in a file with the report form output file in a DOS call this way: RUN COPY C:\PATH\PRT_CTRL.STR+C:\PATH\FRXOUT.TXT C:\PATH\FILENAME.TXT. But who wants a DOS call anyway? There's gotta be a good way to do this!! Help! Thanks.... George ÿ Msg#: 230376 Date: 10-Mar-92 Fm: Dave Watkins [Fox] 76004,2575 To: George Denniston 74730,3546 George, What about setting your p_17cpi variable on the very first line of your report. The variable would still be set to your ASCII control characters, and you would just have that variable be the very first thing that is sent to the printer. This eliminates the step of using the ??? command to send the output directly to the file. Dave Msg#: 23054 Date: 10-Mar-92 Fm: Lisa Slater 72077,2417 To: George Denniston 74730,3546 How about SET PRINT TO SET PRINT ON * do your codes here with ?'s SET PRINT OFF... Now you have a "prolog" file. In fact, I'd include it in the app, since it isn't going to change and you'll use it a lot. Now when you are ready for a report, you just do this: COPY FILE prolog TO filename.txt SET PRINT TO filename.txt ADDITIVE REPORT FORM something TO PRINT SET PRINT TO .. I haven't tried this, but doesn't it seem as though it would work nicely? >L< Msg#: 242399 Date: 02-Apr-92 Fm: roy plum 70404,1535 To: DAVID KRUMHOLZ 73330,3652 David, I've done several forms to print on plain paper in PCL compatible printer. I've used all of the following: A Softfont (8 pt Helvetica Bold) dl'd to the printer as 'permanent' at startup of program. Using a font editor to change one or more seldom used characters in the softfont to logos or logotype. creating a pcx file of the logo and using Hijack to convert this to pcl, then in a text editor (FP's works great for this), add macro definition commands and positioning commands. (this is a lot easier than it sounds) the macro is made 'permanent' and downloaded at startup. The invoice (or whatever) has a turn on macro command imbedded in it, the macro has been defined as an overlay, which means it prints on every page when turned on. the report summary turns it off. I mostly draw rules in the report writer (one line tall boxes) down rules are ruling characters placed in the detail line. (be sure the LaserJEt is using character set PC-8) I'll turn underline on or off at specific places with pcl commands in report variable located in the report. (tip -- use a countr and IIF() to underline every 5th line on long reports) Finally, you can encode the entire preprint as an overlay macro, and turn it on and off as required. You'd probably want to get a forms package to do this, I believe Delrina's PerForm Pro has this capability. (hand coding in pcl is tedious and difficult to debug, it either works or it doesn't) Pick up a good PCL reference like 'The Laserjet Handbook' which is a lot clearer than the pcl info given in the HP manuals. You can talk that old HP into almost anything. roy.