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:
mol = oechem.OEGraphMol()
oechem.OESmilesToMol(mol, "c1ccccc1")
oedepict.OEPrepareDepiction(mol)
report = oedepict.OEReport(3, 1)
oedepict.OERenderMolecule(report.NewCell(), mol)
data = oedepict.OEWriteReportToString("pdf", report)
Note
In Python 3 the OEWriteReportToString
function returns bytes
.