?
Solved

Printer Canvas Question

Posted on 1998-10-10
5
Medium Priority
?
253 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 150 total points
ID: 1342442
Ok, good luck.

I sometimes make such kind of mistakes also.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

770 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