Solved

Printer Canvas Question

Posted on 1998-10-10
5
248 Views
Last Modified: 2010-04-06
I'm printing a form several times, running a loop and a procedure that uses the printer.begindoc and printer.enddoc method. I paint on the canvas using the textout procedure.

Here is my question: what is the most efficient way of clearing the canvas in between pages? Attempting to free and recreate the canvas causes an access error.

Here's a code chunk: the procedure writes sundry things to the canvas:

   if PrintDialog1.Execute then
      with printer do
         for i := 0 to 1 do begin
            main.caption := 'Printing ' + datetostr(tempdate + i);
            BeginDoc;
            canvas.font.size := 12;
            fillshift(tempdate + i,week,1 + i);
            EndDoc;
         end;
0
Comment
Question by:oneeye
  • 3
  • 2
5 Comments
 

Author Comment

by:oneeye
ID: 1342438
Edited text of question
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1342439
Have you every tried not to "clear" the canvas?

As I understand, you needn't clear the canvas,
since when you begindoc, the printer canvas is a new one,
which is OK to draw for the next page you want to print.
0
 

Author Comment

by:oneeye
ID: 1342440
My second and subsequent pages appear to be overlayed on top of the first, so I can but assume that something is not clearing it.
0
 

Author Comment

by:oneeye
ID: 1342441
Argh.

I'm such an idiot. What appears to be one canvas overwriting the other was the font style.. fsUnderLined which I left turned on.

Since you were correct, resubmit and I'll approve the point transfer.
0
 
LVL 4

Accepted Solution

by:
dwwang earned 50 total points
ID: 1342442
Ok, good luck.

I sometimes make such kind of mistakes also.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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 …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

914 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

19 Experts available now in Live!

Get 1:1 Help Now