Magno 4 Posted April 22, 2019 I need to "compress" a barcode type Code128 print with a termal printer. The size needed is 3.5cm. I have a TImage with a size that if I print it works as it should. The Printer form I am using has a kind of TImage so I can move the image using TImage.Picture, but I supposed that once I stretch the report form image it could be printed, but no. The final rendered image gets "cutted" or lost the quality. I really dunno how to fix it. Share this post Link to post
Lars Fosdal 1792 Posted April 22, 2019 Can you set the TImage canvas info to the same properties as the printer canvas? From experience, the PPI / resolution / dimension puzzle comes into effect, and if the TImage is operating with different world coordinate resolution than the printer, you run into problems with scaling. If you use WinAPI GetDC and GetDeviceCaps on the printer - you should be able to get the info you need. Share this post Link to post
Attila Kovacs 629 Posted April 22, 2019 (edited) 1 hour ago, Magno said: I have a TImage with a size that if I print it works as it should. With custom display DPI's too? Doesn't your thermal printer support any language? Edited April 22, 2019 by Attila Kovacs Share this post Link to post
Magno 4 Posted April 23, 2019 As the printer is under Windows drivers, I will try do figure out how to get its DPI. Actually it is using the desktop VGA (72dpi). I've even tried setup to 300 and no changes. Quote If you use WinAPI GetDC and GetDeviceCaps on the printer - you should be able to get the info you need. This is what I need to know how to. Share this post Link to post
Lars Fosdal 1792 Posted April 24, 2019 My Bad - I had forgotten that you can't use GetDC for a printer. You need to use CreateDC. https://docs.microsoft.com/en-us/windows/desktop/printdocs/printer-output Share this post Link to post