MATLAB: Can’t I open a PDF file generated by Report Generator

conversiondocumentexceptionfailedjavajava.lang.outofmemoryerrorMATLABmswordopeningword

When using Adobe Acrobat to open a PDF file produced by the Report Generator, the following error is returned:
There was an error opening the document. The file is damaged and could not be repaired.
If the output format is designated as HTML, the output is rendered correctly and the files can be opened.

Best Answer

The Report Generator is not able to produce the PDF report because it has run out of memory in the creation process. This can be seen by performing the following steps:
1. Open the Message List window in the Report Generator
2. Set the level to "6) All Message"
3. Run the report
At the end there will be a message that looks like:
Document conversion failed Error using ==> rpt_xml.db_output.convertReportJava exception occurred: java.lang.OutOfMemoryError
To resolve this, increase the amount of heap space available to the Java Virtual Machine. To refer to the Related Solution listed below.
If only some of the pages are rendered, then incrementally increasing the heap space can help render more pages.