Solved

Printing Error

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 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