Solved

Printing Error

Posted on 2000-02-23
2
273 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 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