We are encountering a heap memory error in the following line:
document.save(byteArrayOutputStream, opts)
The document size is only 229.4 kB, and the method is used to extract HTML text from all content controls.after …...especially for documents with many images. Consider if you need all these...to be true as these encode images and fonts into the HTML file...