Solved

Printing directly to a printer

Posted on 1998-10-12
4
230 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
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 100 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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