Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

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....
0
uy_andrew
Asked:
uy_andrew
  • 3
  • 3
  • 2
1 Solution
 
gj62Commented:
What OS are you on?  If Windows, are you writing a console application, or a Windows app?  What type of printer are you using?
0
 
mlmccCommented:
listening
0
 
mlmccCommented:
Do you have the printer manual?  Does it have escape codes?

mlmcc
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
uy_andrewAuthor Commented:
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.
0
 
mlmccCommented:
Can it print in landscape or dsoe your program have to do that?

mlmcc
0
 
gj62Commented:
According to the documentation, the Epson LX300 does not have a landscape print mode.

You're program would have to define it's own font and print in graphics mode in order to do this - that would be quite an extensive driver that you  would have to write...

Epson has all their documentation online at www.epson.com - you can check out any printer you need there (well, any Epson printer that is...)
0
 
uy_andrewAuthor Commented:
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.
0
 
gj62Commented:
Great - good luck...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now