************************************* * * * DB/C Newsletter * * March 2003 * * * ************************************* News and Comments The days of printing fixed font reports to 14 by 11 computer greenbar paper have passed. Modern computer applications are expected to produce nicely formatted reports on standard letter-sized paper. The Adobe PDF file format is indispensable for producing such reports that are portable between various printers and operating systems. Support for direct creation of PDF files using the DB/C language PRINT statement was added in DB/C DX 10. Enhancements to this feature have been made in DB/C DX 11 and 12 and will continue to be made in future releases. This month's article is an overview of PDF files and DB/C DX 12. don.wills@dbcsoftware.com ****************************************************************************** PDF files and DB/C DX 12 Printing in DB/C DX has evolved through the years. An overview of the various types of printing and print destinations can be found in the June 2000 DB/C Newsletter (see the DB/C Newsletter Archives at www.dbcsoftware.com). Here is a simple example of how printing to PDF files is done in DB/C DX: PRT PFILE SPLOPEN PRT, "OUT.PDF", "L=PDF" PRINT PRT; *FONT="TIMES(10,BOLD)", *P=300:300, "Hello World!" SPLCLOSE PRT This example creates a PDF file named OUT.PDF that, when printed or displayed, shows one page with the words "Hello World" displayed in black 10 point bold Times Roman text on a white background located exactly one inch from the top and one inch from the left side of the page. Note that we assume that the text color is black and the positioning metric is 300 dots per inch. The PDF files created by DB/C DX programs use just a small portion of the features defined in the Adobe PDF Reference standard. This article provides details about each of the features that are supported by DB/C DX. Fonts are an important aspect of portable printing. There are three types of fonts in PDF files: . standard fonts (all PDF viewers are required to support these) . fonts embedded in the PDF file . fonts external to the PDF file DB/C DX 12 supports 12 PDF standard fonts. Using the actual PDF names, here is the list of PDF standard fonts that DB/C DX 12 makes use of: Times-Roman Helvetica Courier Times-Bold Helvetica-Bold Courier-Bold Times-Italic Helvetica-Oblique Courier-Oblique Times-BoldItalic Helvetica-BoldOblique Courier-BoldOblique The DB/C DX PRINT *FONT control code specifies the font family name. For PDF files, "TIMES", "HELVTICA", "COURIER", and "SYSTEM" may be specified in the *FONT control code. Upper/lower case does not matter for the font names specified in *FONT. The "SYSTEM" font is equivalent to "HELVETICA". Other font names specified in *FONT are implicitly treated as "COURIER". The values "BOLD", "ITALIC" and "PLAIN" that are specified inside the parentheses are used to complete the specification of the PDF standard font name. DB/C DX 12 does not support fonts embedded in the PDF file or fonts external to the PDF file. DB/C DX 12 PDF support provides for printing text in any orientation via the *TEXTANGLE control code. The PDF standard provides an option for text compression. However, DB/C DX 12 does not compress text. The SPLOPEN orientation and paper size (7) options are supported for PDF files. The Adobe PDF standard provides for a variety of color representations including grayscale, RGB and CMYK at any bit depth. DB/C DX 12 PDF color support uses a 24 bit RGB color representation where each of the red, green and blue components of a color has a value from 0 to 255. The *COLOR control code allows for a numeric value for the 24 bit RGB value as well as for the eight standard colors specified by name. The Adobe PDF standard provides for a quite extensive variety of graphics operations including transparency. DB/C DX 12 PDF support provide only for drawing opaque straight lines of various widths. The Adobe PDF standard provides many options for dealing with images. Monochrome, grayscale and color images are supported. Both lossy and lossless compression methods are available with many parameters. The PRINT statement causes DB/C DX 12 to convert the image in to a 24 bit per pixel image which is then encoded with a run-length-encoding algorithm. This algorithm is lossless which means that the image will be reproduced perfectly by the PDF viewer. However, for color pictures, the compression is negligible and the resulting PDF files are large. The PDF file created by DB/C DX 12 is created in a single pass with minimal compression as described above. This makes PDF file creation run fast, but the resulting files will be larger than necessary - sometimes very much larger than is possible. For many PDF files, the larger size is not a problem. However, in some situations, the resulting PDF files are unacceptably large. In addition, when a PDF file is created in a single pass, it is not optimized for quick startup (first page display) in applications where the PDF file is downloaded over the Internet. There are several third-party products that can be used to process PDF files. Compression, encryption, thumb-nail creation, and optimization for download are a just few of the features that are found in various products. Here are some products and web sites that may be of interest: Adobe Acrobat by Adobe www.adobe.com PDF Enhancer by Apago www.apago.com various www.pdfzone.com various www.pdfstore.com ****************************************************************************** DB/C DX Class Schedule Class: DB/C DX Fundamentals Date: June 2003 Location: Oak Brook, Illinois For information, send email to 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 monthly, just send an email message to 'dbcnews-subscribe@dbcsoftware.com'. The newsletter will be delivered to the email address from which the message was sent.