Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Printing directly to a printer

Posted on 1998-10-12
4
Medium Priority
?
246 Views
Last Modified: 2010-04-06
I am using Delphi3.02. Is there a way to print directly to the printer? I need to print individual mailing labels to an epson printer (4013 labels) and qreport doesn't seem to cut it.
0
Comment
Question by:jfreisen
[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
4 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1342598
What do you need to print directly to the prinet??? Simple text, bitmap, other images???

Vik
0
 
LVL 3

Expert Comment

by:philipleighs
ID: 1342599
Hi,

You should avoid printing to the printer directly. Let your epson printer driver do this for you.

You don't have to use quick reports though.

Consider using the Canvas property of the Printer object to do your drawing.
Something like this:

Printer.BeginDoc;
Printer.Canvas.TextOut(100, 100, "Some text");
Printer.EndDoc;

You can get the width of the page (in pixels) using the Printer.Width property. Change the font using Printer.Font (or Printer.Canvas.Font, I forget which one).

You'll be in for more work than using quick report though.
Why is it that quick report doesn't do that you need?

Phil.

0
 
LVL 8

Accepted Solution

by:
Answers2000 earned 400 total points
ID: 1342600
OpenPrinter, WritePrinter, ClosePrinter APIs let you send data directly to a printer.

You can call these form Delphi.

You are then responsible for sending all escape codes, etc.
0
 

Author Comment

by:jfreisen
ID: 1342601
I have a program that prints one to two labels at a time to an Epson printer(4013 labels). I have not been able to get it to work with Qreport2.0k so that it prints 1-2 labels and does not do a form feed. I am using Nt and 95 and setting up the printers are a little bit different(custom paper size, Form feeds, ect).
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

636 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