How to convert any document to SVG format programmatically?