var
dp, ppi: Int32;
di: Int32;
begin
ShowMessage(Format('
%dx%d'#13#10'
%dx%d'#13#10'
%dx%d'#13#10'
%dx%d', [
PrintPreview1.PageSize.X, PrintPreview1.PageSize.Y,
PrintPreview1.PageDevicePixels.X, PrintPreview1.PageDevicePixels.Y,
PrintPreview1.PageLogicalPixels.X, PrintPreview1.PageLogicalPixels.Y,
Printer.PageWidth, Printer.PageHeight
]));
dp := Round(Sqrt(Sqr(PrintPreview1.PageDevicePixels.X) + Sqr(PrintPreview1.PageDevicePixels.Y)));
di := Round(Sqrt(Sqr(PrintPreview1.PageDevicePixels.X
div GetDeviceCaps(PrintPreview1.Printer.Handle, LOGPIXELSX)) + Sqr(PrintPreview1.PageDevicePixels.Y
div GetDeviceCaps(PrintPreview1.Printer.Handle, LOGPIXELSY))));
ppi :=
dp div di;
ShowMessage(IntToStr(
dp div (
dp div 96)));
end;