How to output Chromatogram/Spectrum as .emf image using IronPython code?

The API Reference only shows how to draws chromatogram/Spectrum and returns as iTextSharp.text.Image object.

But I want draws the selected chromatogram/Spectrum and output Chromatogram/Spectrum as .emf images, and then save them to hard disk.

Could you show me the IronPython code?


  • Hello  ,

    From what I can see the MassHunter SDK has no specific function to export graphics. iTextSharp could be used to make a pdf of each image and then you could use another utility or library to convert each .pdf to a .emf file, but there is nothing built into Python, IronPython, or iTextSharp to do this.

    One option in MassHunter, if you don't mind getting all of the graphics for a batch and having to sort through them, would be to set up your reporting method to create the .emf files. This is on by default for Excel graphics reporting, but you can force any report type to create the results file and the .emf graphics files. On the reporting method Results tab set the Generate report results option to Yes and on the Graphics settings tab under General select Generate graphics files (.emf files) and disable Delete graphics files after report generation. 

    Ther report folder will now have folders for each graphics type which will contain all of the graphics for the batch.

    This can take a bit of time and will consume disk space, which is why these options are usually set to only make these files for Excel graphics reports and to delete the .emf files after the report is created, but it is the only built in way I'm aware of for creating these files. 

  • Yes, I knew this method, but I found the running speed of this method is too slow, since the software will export all the graphics for each compound of every sample in the batch.

    Anyhow, thanks for your information.

Was this helpful?