paint.end

Post Reply
sadams54
Posts: 37
Joined: Monday 09th July 2018 3:43am

paint.end

Post by sadams54 » Tuesday 14th January 2020 10:17pm

With the latest update many things changed and no backward compatibility was considered. I have fixed my printing problems with the help of benoit, but one remains.
In the past it worked fine. I set the number of pages for the document in the begin method. The it called the draw as many times as there are pages. each time you end the page with a paint.end command. Problem is now this works for a single page no issue. It crashes on subsequent pages with the error "No current device" on the first command to try to use the paint object. Something has changed. What is the new method to end a page and start the next?

User avatar
grayghost4
Posts: 65
Joined: Wednesday 05th December 2018 5:00am
Location: Concord, CA usa

Re: paint.end

Post by grayghost4 » Thursday 16th January 2020 2:46am

give this a try , it should print three pages :
Public Sub PrintButton_Click()
  
  If Printer2.Configure() Then Return
  Printer2.Count = 3
  Me.Enabled = False
  Inc Application.Busy
  Printer2.Print
  Dec Application.Busy
  Me.Enabled = True
End


Public Sub Printer2_Draw()
 Paint.DrawRichText("hello", 300, 300)
 Paint.DrawRichText("page # " & Printer2.page, 400, 600)
End 

sadams54
Posts: 37
Joined: Monday 09th July 2018 3:43am

Re: paint.end

Post by sadams54 » Thursday 16th January 2020 7:03pm

Hey, thanks so much. Your answer was a bit wordy but that did the trick.

You could simplify the answer for others by just saying to eliminate the paint.end command and it all works.

Looks like the paint.end command is no longer needed.

Thanks again for the help.

Post Reply