Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delphi printing oddities

Status
Not open for further replies.

Rossco2

Programmer
Oct 21, 2009
1
GB
Hi guys, first post here so be gentle :)

Im having some bother with printing in delphi and im wondering if anyone has come across the same issues that im having.

We create images of charts, lots of lines and shaded areas, all created on a delphi TMetafileCanvas, this is then sent to the printer in a page by page notion as defined by the setting of the printer.

Sometimes it works fine, sometimes it will just miss out a huge chunk of the image, like it will get halfway through a page and then literally just stop. Then on the next page draw everything fine. Its not even consistent in where it fails, you can print the exact same image after one that had failed and it will print out fine. The worst thing is there are no error messages shown either.

I had originally suspected some form of memory issue but everything seems to be getting disposed of and cleaned up correctly.

Does anyone have any suggestions or previous experience of this type of issue?

Regards

Ross
 
From the lack of responses, I'd suggest that no, your issue hasn't been encountered by others here.

Without seeing your code, it's impossible to suggest what the issue may be.

I would test where the issue lies by creating your TMetafileCanvas, send it to the printer, and then keep that object around by adding it to a TObjectList (TObjectlist will free it's objects when itself is freed). After the print, if the page has come out corrupted, retrieve the object from the TObjectList and print again. If it prints fine or corrupted in a different way, then the problem is with your printer driver. If it's still corrupt in the exact same way, then the problem is with your code somewhere.

To test the printer driver, try a different model printer if available, or set up a new printer in Windows, point it to your physical printer, but use the (built-in Windows) HP LaserJet 5 print driver. This driver should be compatible with any black laser printer.

If it still prints out corrupt, then post back with more info.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top