is there any library about this inside the .net framework? or any other open source?
you can use the XPSDocument class in .NET to do this. Here is the documentation to the call to write a Visual to an XPSDocument