Output Streams
In conversion operations, we normally save the rendering result to the file. However, for some cases, you may need to store the result in the memory or send it to the remote storage. You can easily do this by implementing the specialized MemoryStreamProvider interface and use it as an input parameter to the converter. This interface represents a callback that uses when a new output stream is required.
Note: It may be invoked a few times when the multiple output streams are required. The scenario when this case is possible is rendering HTML to the set of image files.
The code below is an example of the application that uses MemoryStreamProvider to store the rendering result in memory and flush it to the file later.