Extract drawing views to .JPG format

Hi all,

I need to extract the drawing views and save them as .jpg images. The images should be named according to the views that they are extracted from (e.g Isometric View, Section View X-X etc)

How do i do that using API? I am working on Solidworks 2011.

Thank you.

SolidworksApi macros