1

I am working on fixing a problem in a program (ReportGenerator) which seems to be an issue with the printed report, either being extremely poor quality or much too large.

This project involves the use of two threads that synchronize the task of preparing the pages for preview and printing them. The start points for these two threads are preventing me from using PrintPageEventArg (an input of PrintDocument_PrintPage) at the proper time in order to use e.graphics that can improve the print quality. To try and work around this issue I created a graphic from a bitmap (graphics.FromImage(bitmap)) but this creates its own problems. In order to use this event I must change the start points for the threads causing even further problems. I have a limited time and I cannot take the time to completely re-write this project. Are there any suggestions as to what I may be able to try in order to find a workaround?

This is a general overview of the project, including the threads and my methods:

  1. Print Show Dialog -> ok
  2. Print_Document_BeginPrint -> Thread begins here 3.Create a graphic from bitmap(graphics.FromImage(bitmap)) From here if I could use PrintPageEventArg my issues would be solved but I am not that lucky

    Alternatively I could create a bitmap and draw a prepared graphic on it (graphics.Draw(..bitmap...)) saving this image on the system and then restoring it in PrintDocument_PrintPage ,This method allows me to use PrintPageEventArg but only after I restore the previously created graphics and print them.

I have asked questions related to this problem before on these links. how to improve printed text quality after using "graphics.DrawString"? save an image as a bitmap without losing quality

Any help would be greatly appreciated. Thanks in advance.

Community
  • 1
  • 1
Shima.Y
  • 373
  • 4
  • 9
  • 18

1 Answers1

0

Confusing.

Why don't you draw into the Graphics created from printer HDC? If you draw into a bitmap Graphics first, the bitmap needs to be of high resulition (e.g. 300-dpi) to get better printing quality. But printing could be slow due to sending large amount of image to printer.

Feng Yuan
  • 709
  • 5
  • 4
  • I didn't understand what did U mean by "Graphics created from printer HDC" ?I tried improving resolution and U R exactly right , printing slowed down ! – Shima.Y Aug 01 '12 at 12:27