************************************* * * * DB/C Newsletter * * June 2000 * * * ************************************* News and Comments For the first time in many years, we are increasing the purchase price of certain DB/C products. This price increase takes effect on August 1, 2000. The price of yearly support will not increase. The good news is that if you purchase or upgrade before August 1, you can take advantage of the current prices. See our web site (www.dbcsoftware.com) for details. In the next week, many customers will be receiving notices of expiration of support of their licenses of DB/C DX, DB/C JX and DB/C FS. The impact of this expiration is that you will no longer be able to refresh your software with the latest version (or beta test versions) via the DB/C Online Sales and Update System. In theory, we won't be answering questions or providing other support via email or otherwise, but generally we like to communicate with all DB/C users, so the policy of no support will be flexible. Also note that all support for DB/C 9.1 will cease on December 31, 2000. This month's article is about printing - one of the least understood areas of DB/C DX and DB/C JX. Hopefully, this will help you understand what options are available. don.wills@dbcsoftware.com ****************************************************************************** Printing Printing is one of the most complicated areas of DB/C. Features have been added to printing in each major release of DB/C. To simplify things, this article will discuss only the current state of printing as it exists in DB/C DX 10. Print functionality falls into these two general categories: device-independent printing and raw-mode printing. Device-independent printing is the mode of printing where the programmer causes the DB/C program to do print functions (draw line, change font) with print statement control codes (*LINE=100:100, *FONT="Courier(12)"). The programmer does not need know the type of printer that is being printed to. Thus, the print destination may be any printer available at runtime. DB/C DX and the operating system handle the details of making sure that the printed output is what the programmer intended. Raw-mode printing is the mode of printing where the programmer specifies the special characters (escape sequences) to accomplish all but the basic print functions. Escape sequences are generally different for each type of printer. It would be quite complicated for a programmer to write a DB/C program that could accommodate the variety of printers that might be used. It would seem that most DB/C programs would use device-independent printing because of the ease of use and better runtime flexibility. That is not the case. Here are a few reasons why: raw-mode printing provides complete control of all printer operations, including those operations that aren't supported by DB/C or by the operating system; raw-mode printing has been available in DATABUS for more than 20 years; and the availability of device-independent print features is not the same for all print destinations. Here is a list of the various types of print destinations: 1. print file with a carriage control character prefix on each record 2. print file with device control characters (escape sequences) 3. an actual printer 4. PDF file 5. Postscript file 6. PCL file 7. a UNIX pipe When the splopen statement executes, it first determines if the print destination is a printer device or UNIX pipe. If it is not one of those, then the destination is assumed to be a file. If the file doesn't already exist, then it is created. If it is a file and the "D", "R" and "L" options are not specified, then the file will be the of the first type from the list. This type of file can be read by other programs, but isn't useful for any real printer except certain IBM mainframe printers. If the print destination is a file and the "D" or "R" option is specified, then the file will contain device control characters (the print destination is the second type from the list). In response to the *C, *N, *L, and *F control codes in the print statement, DB/C outputs CR, NL and FF characters. User specified escape characters may also be sent to this destination to control other capabilities of the printer. This type of file can be sent directly to a printer that understands the escape sequences that are in the file. If the print destination is a file with the "L=PDF", "L=PS" or "L=PCL" option, then the file is created in the format specified. In UNIX, if the print destination name starts with "/dev", then it is assumed to be a device. In UNIX, if the "P" (pipe) option is specified, then the print destination is an executable command that is executed with stdin redirected to accept the characters that are printed. In Windows, if the print destination name starts with "LPT", "COM", "PRN", "AUX" or "NUL", then it is assumed to be a raw printer device. Printer control is done with raw device control characters (escape sequences). If, in Windows, the print destination isn't a raw printer device, then an attempt is made to open the print destination with the Win32 OpenPrinter function. This will succeed if the print destination is the name of a configured printer - that is, a printer that was configured with the Settings -> Printer -> Add Printer action. The following table describes which types of print statement actions are supported by the various types of print destinations. Destination and environment | raw bytes | *LINE, *FONT | image variables ----------------------------|-----------|--------------|----------------- default file (type 1 above) | No | No | No PDF file | No | Yes | Yes PCL and Postscript file | No | Yes | No UNIX file, device and pipe | Yes | No | No Windows file and raw device | Yes | No | No DBCC.EXE configured printer | Yes | No | No DBC.EXE configured printer | No | Yes | Yes Note that in UNIX and in DBCC.EXE, image variables are only supported via the LOAD and STORE statements, and not by the DRAW statement. When running under DBC.EXE in Windows, all of the graphical details are handled by the graphics engine that is part of Windows. Issues such as font metrics can be fully resolved because DBC.EXE has complete knowledge of the actual runtime environment. In PDF, PCL and Postscript files, font metrics can only be approximated by DB/C. Font metrics can generally be ignored. However, if the print position is defined by the width of text that was previously printed, then the page will typically look different depending on the fonts that are available at the actual print or display destination. This result occurs because the font metrics may be different for each destination. The print capabilities of DB/C DX and DB/C JX will continue to be enhanced in the years ahead. ****************************************************************************** DB/C Class Schedule Class: DB/C DX and JX Language Fundamentals Date: July 10-12, 2000 *** SOLD OUT *** Location: Oak Brook, Illinois For information, contact Judi Tamkevic at: voice 630.572.0240 email admin@dbcsoftware.com ****************************************************************************** Subscribing to the DB/C Newsletter If you don't already have the DB/C Newsletter delivered to your email address and would like to have it emailed to you when it is produced, just send an email message to 'request@dbcsoftware.com' and put the line 'subscribe dbcnews' in the body of the email message (omit the ' characters). The newsletter will be delivered to the email address from which the message was sent. To stop delivery, put the line 'unsubscribe dbcnews' in the body of the message.