Jump to content
Geoff88

Delphi 5 Printing

Recommended Posts

Is anybody aware if Win 10 has changed its API in regard to printing?  My flagship program has been running for 20yrs but suddenly 2 customers who have purchased new HP printers have found they cannot print from it.  Then yesterday another custome found they could not print to an older Canon printer despite loading the newest drivers and also despite other programs being able to print.  Has everybody moved over to GDI printing? and if so is there a Delphi 5 solution?

Share this post


Link to post

Well, how are you printing at the moment, if not using GDI? And GDI printing must be like 30 years old now. 

  • Like 1

Share this post


Link to post

TPrinter/TCanvas is GDI printing.

It's likely that there are bugs in TPrinter in Delphi 5 that has since been fixed. I seem to recall that there were quite a lot of them. Buffer overflows and whatnot.

 

What has happened is probably that your application has been using GDI in a way that was invalid but was worked around by Windows and now they've stopped working around it.

  • Like 1

Share this post


Link to post

Thanks for those inputs.  From what you have said, and since the program is working quite happily on many other computers including the development machine, I have a suspicion that it may be the drivers and not Windows after all.

Share this post


Link to post
Posted (edited)

@Geoff88:

 

ShellExecute(Application.Handle, PChar('print'), PChar('A:\Path\to\a\file\to\print.pdf'), PChar(''), nil, SW_HIDE);

you can let windows handle everything with that.

this would open whatever programm is associated to print that file.

 

//edit

if you want full control, customized-printing-in-delphi, here you find everything you need.

Edited by KodeZwerg

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×