Hi guys,
Looking for some help again... I've searched the forums and I've come as far as this:
Code:
#include <stdio.h>
#include <conio.h>
#include <stdafx.h>
int main(void)
{
char ih;
FILE *fp=fopen("lpt4", "w"), *fpin=fopen("test.pdf", "rb");
char flin[256];
if ( fp == NULL )
{
perror( "No printer" );
getch();
exit( 1 );
}
while((ih=fgetc(fpin))!=EOF)
{
fputc(ih,fp);
putch(ih);
}
getch();
return 0;
}
with the examples I've found. This bit of code doesnt print anything though. It works fine for a text file (because the fputc bit sends every single character to the printer) but it doesnt work for a pdf or other non-text file...
Does anyone have an idea of what to do to make this work?
I've also tried
Code:
fprintf(fp, "test.pdf");
But that results in a nice A4 paper with the text string "test.pdf" on it
Hope you can help, thanks a lot in advance!
René