Ejemplo n.º 1
0
        /// <summary>
        /// Reads the WMF into a template.
        /// </summary>
        /// <param name="template">the template to read to</param>
        public void ReadWMF(PdfTemplate template)
        {
            TemplateData    = template;
            template.Width  = this.Width;
            template.Height = this.Height;
            Stream istr = null;

            try {
                if (rawData == null)
                {
                    WebRequest w = WebRequest.Create(url);
                    istr = w.GetResponse().GetResponseStream();
                }
                else
                {
                    istr = new MemoryStream(rawData);
                }
                MetaDo meta = new MetaDo(istr, template);
                meta.ReadAll();
            }
            finally {
                if (istr != null)
                {
                    istr.Close();
                }
            }
        }
        /// <summary>
        /// Reads the WMF into a template.
        /// </summary>
        /// <param name="template">the template to read to</param>
        public void ReadWmf(PdfTemplate template)
        {
            TemplateData    = template;
            template.Width  = Width;
            template.Height = Height;
            Stream istr = null;

            try
            {
                if (rawData == null)
                {
                    istr = url.GetResponseStream();
                }
                else
                {
                    istr = new MemoryStream(rawData);
                }
                var meta = new MetaDo(istr, template);
                meta.ReadAll();
            }
            finally
            {
                if (istr != null)
                {
                    istr.Dispose();
                }
            }
        }