Link to home
Start Free TrialLog in
Avatar of uy_andrew
uy_andrew

asked on

Printing to the Printer in C Language wherein you can specify the format of the font

What codes in C Language in particular do i need in order to print to the printer the strings like "Hello World" with the specified font that i want like Gothic font, Times New Roman, ....

I have tried printing to the printer but it usually comes out with the default font which i think is like Courier, which is like a typewritter font.

I used this code in doing my printing job --> fprintf(stdprn,"%s",string)

Example of my code:

#include <conio.h>
#include <stdio.h>

void main()
{
   char S[100] = "Hello World\n\r";
   fprintf(stdprn,"%s",S);
}


What code do i also need in order to have the printer print in landscape instead of portrait.

---------               -----------------------
|          |                |                           |
|          |                |                           |
|          |                |                           |
|          |            -----------------------
|          |
---------


PORTRAIT                              LANDSCAPE


I have read one of the question about printing and it was suggesting about escapecodes for formatting. Where can i get those escape codes?


Thank You in advance....
Avatar of gj62
gj62

What OS are you on?  If Windows, are you writing a console application, or a Windows app?  What type of printer are you using?
Avatar of Mike McCracken
listening
Do you have the printer manual?  Does it have escape codes?

mlmcc
Avatar of uy_andrew

ASKER

I have solved my problem by using registers in C Program. The problem now is how to Envoke the Printer to Print in Landscape Orientation? What Printer Codes shall i use if i am using Epson Printer especially dot matrix epson printer like Epson LX300. I am in a Windows Environment but the program is in MS-DOS environment.
Can it print in landscape or dsoe your program have to do that?

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of gj62
gj62

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To mlmcc: Its my program that needs to do the landscape thing. Anyway, Thank you for helping me solve the problem.

To g162: Thank You. I think i have solved my problem.
Great - good luck...