I have been looking for a way of retrieving the papers supported by an specific printer and their sizes (width and height) in millimeters if possible.
I have seen and "Studied" many posts and sites about using Printer.Getprinter
and Printer.SetPrinter
but I am really far from understanding the whole process to make that work, I learnt that I have to use DeviceCapabilities
in order to retrieve data that is specific to one printer but I really don't know how to use those structures. I need something similar to this but for a specific printer and using the DeviceCapabilities
.
I use Delphi VCL.
In the question linked, they use EnumForms
which I understand is for all the printers, they also mention that DeviceCapabilities
is for a specific printer, and that is what I need, to get the supported paper names and sizes but only for the selected printer and not all of them.
lets say I select my printer: Printer.PrinterIndex:= Printer.Printers.IndexOf(MyPrinter);
I would like to get the papers and paper sizes for those supported by that printer.
Thank you so much for any help provided!