-def renderIcon(icon_path: str | None) -> bytes:
- return b'\\includegraphics{%s}' % icon_path.encode(
- 'UTF-8') if icon_path else b''
+def renderIcon(icon_path: str | None, image_size: float) -> bytes:
+ return b'\\includegraphics[width=%fmm,height=%fmm,keepaspectratio]{%s}' % (
+ image_size, image_size, icon_path.encode('UTF-8')) if icon_path else b''