-
printing landscape
Is there any code i could add to this function to make it print landscape rather than portrait?
Code:
/* PRINT CUSTOMER DETAILS */
void f_print_customer ( void )
{
FILE *fp = fopen ( "customers", "rb" );
FILE *printer = fopen( printerDevice, "w" );
CUSTOMERRECORD cr;
char continue_c;
if ( printer == NULL )
{
printf( "PRINT HALTED: Unable to access printer" );
return;
}
if ( ( fp = fopen( "customers", "rb" ) ) == NULL )
{
printf( "The file does not exist." );
return;
}
/* prints time and date */
{
time_t rawtime;
time ( &rawtime );
fprintf ( printer, "Printed on %s\n", ctime ( &rawtime ) );
}
fprintf( printer, "___________________________________________________________\n" );
fprintf( printer, "DESIGNER DETAILS\n\n" );
while ( fread( &cr, sizeof( cr ), 1, fp ) == 1 &&
fprintf( printer, "%d %10s %19s %14s %8s %13s %5s %10s\n", num_of_items_i + 1,
cr.surname_s, cr.address1_s,
cr.city_s , cr.postcode_s,
cr.telephone_s, cr.time_s, cr.date_s ) > 0 )
printf( "Print complete" );
do{
printf ( "\n\nPress y to continue..." );
fflush( 0 );
scanf ( "%c", &continue_c );
}
while ( continue_c != 'Y' && continue_c != 'y' );
fclose( fp );
fclose( printer );
}
-
You have to use printer specific escape sequences.
Google for code examples, but you'll have to lookup escape sequences for your printer.
The other alternitive is to use OS specific printing libraries (like the Win32 API under Windows).
gg