OEWriteReportToString¶
std::string OEWriteReportToString(const std::string &ext,
const OEReport &report, unsigned int page=0)
Writes the report into a string.
- ext
The extension which determine the type of the image.
- report
The OEReport object of which page(s) is/are being written into the string.
- pageidx
This value has to be in the range from 0 to
OEReport.NumPages()
.
Note
If \(pageidx\) is a valid page number i.e in the range from 1 to
OEReport.NumPages()
,
then only the \(pageidx^{th}\) page of the report is written into the
string.
If \(pageidx\) is zero and the file extension is recognized as a multi-page
format, than all pages of the report are written into the string.
Example:
OEGraphMol mol = new OEGraphMol();
OEChem.OESmilesToMol(mol, "c1ccccc1");
OEDepict.OEPrepareDepiction(mol);
OEReport report = new OEReport(3, 1);
OEDepict.OERenderMolecule(report.NewCell(), mol);
byte [] bytes = OEDepict.OEWriteReportToByteArray("pdf", report);
See also
OEIsRegisteredMultiPageImageFile
function