I added an attribute max-width to the img tag.
.half-img {
max-width: 283px;
}
<table>
<tr>
<td class="table-top">
<div class="number">1.</div>
ae913d52-c459-48a2-b6b4-4e5a7b67f02a
</td>
<td class="table-top">
<div class="number">2.</div>
<img class="half-img" src="xxx.jpg" alt=""/>
</td>
</tr>
<tr>
<td>
<div class="number">3.</div>
test text
</td>
<td class="table-last"></td>
</tr>
</table>
At this time, it works normally in the browser.

However, if I use flying-saucer-pdf-itext5 to generate a pdf file, the image cannot be scaled and displays the original size. The image jumped out of my pdf border.

Each of my images is a different size, so I can't use the width attribute to achieve that.
I would like to know how to fix it, or is there any other way to achieve a similar result.
My flying-saucer-pdf-itext5 version is 9.3.1.