<div dir="ltr">hi all.<br>i was able to generate a legend when i was using 

QGIS 2.18  by QgsComposerLegend().Then i used to export it with help of QImage().<br>But now i use QGIS 3.10 and i have to use QgsPrintLayout() and QgsLayoutItemLegend() to generate legend  and i export it  via QgsLayoutExporter(). But i have some issue with that:<br>1. it exceeds or crops legend content.<br>2. i got below error message when i create more than one object of my class which has QgsPrintLayout() object : "RuntimeError: wrapped C/C++ object of type QgsPrintLayout has been deleted"<br><br>can you please guide me about this?</div>