With legs $a,b$ and hypotenuse $c$, $\frac{ab}2=2(a+b+c)$ gives $c=\frac{ab}4-a-b$. Squaring and using $c^2=a^2+b^2$: $\frac{a^2b^2}{16}-\frac{ab(a+b)}2+2ab=0$, i.e.\ $ab-8(a+b)+32=0$, so $(a-8)(b-8)=32$ (Theorem 106). (Both factors are positive, since $a-8,b-8\ge-7$.)
$32=1\cdot32=2\cdot16=4\cdot8$, giving legs $(9,40),(10,24),(12,16)$.