The Render class has a CreateImageFile() method which renders to a specified filename.
A more general approach is to render to a Stream object.
This way, it can be used to render to an in memory object which may be placed within another object (e.g. PDF).
Another reason is that some of the hosting providers that may run the code may not allow 'write' access to the filesystem and would make
it impossible to use the code in that environment.
Thanks for the code, it appears to work well!