send data to printer and print on paper
I want to ask about how to send data to printer and print on paper. My data is not text file but it is barcode pictrue in pbm format. This format is simple. 1 is solid black character 0 is solid white like this
111001100111100111001100
111001100111100111001100
111001100111100111001100
111001100111100111001100
Can you tell me how to send this data to printer and print in solid black and white character.I see the past post. There is code to print text file below.Do you know how to edit this below code to print barcode ? Thank you for your answer.
(I use Window ME and Visual C++ 6.0)
code:--------------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
FILE *printer = fopen("LPT1","w");
FILE *fp;
char str[256];
char buf[BUFSIZ];
printf("File name? ");
scanf("%s",str);
fp = fopen(str,"r");
if(!fp)
{
printf("File does not exist\n");
return -1;
}
fgets(buf,BUFSIZ,fp);
while(buf[0])
{
fprintf(printer,"%s",buf);
fgets(buf,BUFSIZ,fp);
}
fprintf(printer,"\f");
return 0;
}
--------------------------------------------------------------------------------