Solved

Printing Error

Posted on 2000-02-23
2
269 Views
Last Modified: 2010-04-04
I try to print with something like this:

Var
prn:TPrinter;
begin
Prn.BeginDoc;
prn.canvas.draw(10,10,Image1.Picture.Graphic);
prn.EndDoc;
end;

or like this:

Var
prn:TPrinter;
begin
prn:=TPrinter.Create;
Prn.BeginDoc;
prn.canvas.draw(10,10,Image1.Picture.Graphic);
prn.EndDoc;
prn.Free;
end;

but it stops with access violation error. I tried to trace the problematic line(by commenting all text except one line each time) and found that the prn.BeginDoc; causes the AV error in both cases.

please help!
0
Comment
Question by:duke_n
2 Comments
 
LVL 1

Accepted Solution

by:
TAZI earned 10 total points
ID: 2550420
Hi...

Make sure that you've added the printers unit to your uses clause above.

uses
  Printers;

try this

Printer.BeginDoc;
 ....
   .... (your text here)
      .....
Printer.EndDoc;

don't declare prn as type TPrinter.

Regards
Tazi

 
0
 
LVL 1

Author Comment

by:duke_n
ID: 2550504
Thanx Greatly.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now