/// <summary>
        /// Generates a document on the server and returns the full url to it.
        /// </summary>
        /// <param name="output"></param>
        /// <returns></returns>
        public static string GenerateImageOnYumlServer(YumlClassDiagram output)
        {
            Logger.Log(string.Format("Generating image on yuml server, class diagram: '{0}'", output), LogLevel.High);

            ServicePointManager.Expect100Continue = false;
            var req = WebRequest.Create(YumlClassUrl);

            //req.Proxy = new System.Net.WebProxy(ProxyString, true);
            //Add these, as we're doing a POST
            req.ContentType = "application/x-www-form-urlencoded";
            req.Method      = "POST";
            //We need to count how many bytes we're sending. Post'ed Faked Forms should be name=value&
            string diagramDescriptionRaw = output.ToString();
            string diagramDescription    = "dsl_text=" + EncodeForHttpPost(diagramDescriptionRaw);

            byte[] bytes = Encoding.ASCII.GetBytes(diagramDescription);
            req.ContentLength = bytes.Length;

            using (var outputStream = req.GetRequestStream())
            {
                outputStream.Write(bytes, 0, bytes.Length); //Push it out there
                outputStream.Close();
            }

            string htmlContent;

            using (var response = req.GetResponse())
            {
                using (var reader = new StreamReader(response.GetResponseStream()))
                {
                    htmlContent = reader.ReadToEnd().Trim();
                }
            }

            var imageFetcher = new ImageFetcher(htmlContent);

            var thread = new Thread(imageFetcher.FetchImageSrc);

            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
            thread.Join();

            return(imageFetcher.ImageUrl);
        }