?
Solved

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

Posted on 2003-03-25
8
Medium Priority
?
268 Views
Last Modified: 2013-12-03
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
Comment
Question by:uy_andrew
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 6

Expert Comment

by:gj62
ID: 8204764
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
 
LVL 101

Expert Comment

by:mlmcc
ID: 8207213
listening
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8207217
Do you have the printer manual?  Does it have escape codes?

mlmcc
0
Technology Partners: 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!

 

Author Comment

by:uy_andrew
ID: 8207717
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
 
LVL 101

Expert Comment

by:mlmcc
ID: 8208054
Can it print in landscape or dsoe your program have to do that?

mlmcc
0
 
LVL 6

Accepted Solution

by:
gj62 earned 300 total points
ID: 8210492
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
 

Author Comment

by:uy_andrew
ID: 8213233
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
 
LVL 6

Expert Comment

by:gj62
ID: 8213259
Great - good luck...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Progress
Starting up a Project

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question