home *** CD-ROM | disk | FTP | other *** search
- RASTER.DRV
-
- This printer driver generates a raster bit image print file. The format of
- the file is as follows:
-
- The raster file is composed of a series of raster lines. The
- raster lines are all oriented along the X axis for compressed
- printing and along the Y axis for scale printing (Scale is
- rotated, Compressed is not). The raster line consists of two
- fields:
- a 16 bit word which is the number of raster bytes that
- are on the line
- the raster byte(s), the number of which is equal to the
- word count above
-
- All raster lines have the same format, but may be different
- lengths as the trailing null bytes have been removed. The
- maximum size of a raster line is for "E" size pages, 600 bytes.
-
- A sample C program to read this file is as follows.
-
-
-
-
- #include <stdlib.h>
- #include <stdio.h>
-
- void main(ArgC,ArgV,EnvP)
- int ArgC;
- char *ArgV[ ],*EnvP[ ];
- {
- char Raster_Line[600];
- int Read_Count;
- int Raster_Line_Count;
- FILE *RFile;
-
- RFile=fopen(ArgV[1],"rb");
- if (RFile == NULL) {
- fprintf(stderr,"ERROR - file does not exist '%s'\n",ArgV[1]);
- exit(1);
- }
- while ((Read_Count=fread(&Raster_Line_Count,1,2,RFile)) != 0) {
- Read_Count=fread(Raster_Line,1,Raster_Line_Count,RFile);
-
- /* <<< PROCESS Raster_Line HERE >>> */
-
- }
- Read_Count=fcloseall();
- exit(0);
- }
-
-