Mega Code Archive

 
Categories / Delphi / Printing
 

Get pixels per inch of printer

Title: Get pixels per inch of printer If you want to get number of pixels per inch of the current printer, then use GetDeviceCaps function. uses Printers; ... procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption:= IntToStr(GetDeviceCaps(Printer.Handle, LogPixelsX)); Label2.caption:= IntToStr(GetDeviceCaps(Printer.Handle, LogPixelsY)); end;