home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p070 / 7.ddi / DRIVER / RASTER.DOC < prev    next >
Encoding:
Text File  |  1987-03-18  |  1.5 KB  |  52 lines

  1. RASTER.DRV
  2.  
  3. This printer driver generates a raster bit image print file.  The format of
  4. the file is as follows:
  5.  
  6.         The raster file is composed of a series of raster lines.  The
  7.         raster lines are all oriented along the X axis for compressed
  8.         printing and along the Y axis for scale printing (Scale is
  9.         rotated, Compressed is not).  The raster line consists of two
  10.         fields:
  11.             a 16 bit word which is the number of raster bytes that
  12.                 are on the line
  13.             the raster byte(s), the number of which is equal to the
  14.                 word count above
  15.  
  16.         All raster lines have the same format, but may be different
  17.         lengths as the trailing null bytes have been removed.  The
  18.         maximum size of a raster line is for "E" size pages, 600 bytes.
  19.  
  20. A sample C program to read this file is as follows.
  21.  
  22.  
  23.  
  24.  
  25. #include <stdlib.h>
  26. #include <stdio.h>
  27.  
  28. void main(ArgC,ArgV,EnvP)
  29.     int         ArgC;
  30.     char        *ArgV[ ],*EnvP[ ];
  31. {
  32.     char        Raster_Line[600];
  33.     int         Read_Count;
  34.     int         Raster_Line_Count;
  35.     FILE        *RFile;
  36.  
  37.     RFile=fopen(ArgV[1],"rb");
  38.     if (RFile == NULL) {
  39.         fprintf(stderr,"ERROR - file does not exist '%s'\n",ArgV[1]);
  40.         exit(1);
  41.         }
  42.     while ((Read_Count=fread(&Raster_Line_Count,1,2,RFile)) != 0) {
  43.         Read_Count=fread(Raster_Line,1,Raster_Line_Count,RFile);
  44.  
  45.         /* <<< PROCESS Raster_Line HERE >>> */
  46.  
  47.         }
  48.     Read_Count=fcloseall();
  49.     exit(0);
  50.     }
  51.  
  52.