Geoff88 0 Posted April 20, 2021 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
David Heffernan 2345 Posted April 20, 2021 Well, how are you printing at the moment, if not using GDI? And GDI printing must be like 30 years old now. 1 Share this post Link to post
Anders Melander 1783 Posted April 20, 2021 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. 1 Share this post Link to post
Geoff88 0 Posted April 20, 2021 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
Vandrovnik 214 Posted April 20, 2021 What about the printer name? Isn't it just quite long? Share this post Link to post
KodeZwerg 54 Posted April 20, 2021 (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 April 20, 2021 by KodeZwerg Share this post Link to post
LarsGP 0 Posted December 27, 2021 Had the same problem, solved it by selecting a different printer, that appeared in my printers list, when I installed my new HP-deskjet printer. Printer name is "HP Smart Printing". I selected that printer as default. Share this post Link to post
PeaShooter_OMO 11 Posted January 12, 2022 A few years back Microsoft released an update that broke printing on Epson Dot Matrix printers. Fortunately it was quickly fixed with a follow-up update as so many financials still work on Dot Matrix printers. We had a busy week that week. https://www.cprou.com/information/windows-update-breaks-dot-matrix-printers/ There are other similar cases. One being; https://www.bleepingcomputer.com/news/microsoft/new-windows-10-kb5006670-update-breaks-network-printing/ Share this post Link to post
Thuddeus 0 Posted May 7, 2022 Anything new on this? I am having the same problem with HP and Canon wireless printers under both Delphi 11 and Delphi 6. All printing from my Delphi programs fails on these printers, whether drawing to the printer canvas or using AssignPrn and writing text to the device. My customers can dump to pdf and print from there, but I was hoping there was a fix, or at least a better work-around, since for some of them, switching printers is not an option. Share this post Link to post
irawan 2 Posted May 8, 2022 6 hours ago, Thuddeus said: Anything new on this? I am having the same problem with HP and Canon wireless printers under both Delphi 11 and Delphi 6. All printing from my Delphi programs fails on these printers, whether drawing to the printer canvas or using AssignPrn and writing text to the device. My customers can dump to pdf and print from there, but I was hoping there was a fix, or at least a better work-around, since for some of them, switching printers is not an option. it is very funny that blaming Delphi for bugs on printer driver (usually this is the source of trouble) will solve this problem. the most reliable way to solve this problem is to communicate with printer driver author. explain your problem and send them your most simple program that show where the problem is. however reaching the author is not as easy at all. Share this post Link to post
TonyB 3 Posted May 17, 2022 This may or may not be relevant, but this thread reminded me of a fix I made a while back, adding the following line to my printing code Printer.Title := ProgName + ' calcs '; // 11.11.18 latest Win10 update falls over without this 1 Share this post Link to post
Attila Kovacs 629 Posted May 17, 2022 define "failing", provide more infos, logs, event logs Share this post Link to post