Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents from any .NET(C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Sun Feb 15, 2015 6:51 pm

Hi Guys,

Is there any way to get higher quality Images from PowerPoint and word. I have tried several of your demos with various EncoderParameter settings but have been unable to get the quality high enough for us to use.

Thanks

John

BTW: Great product, I really hope you can help me get the quality we need so we can use this product

john@screendragon.com
 
Posts: 2
Joined: Mon Dec 01, 2014 3:46 pm

Mon Feb 16, 2015 10:21 am

Hello,

Thanks for your inquiry. Regarding word to image, you could save it to emf format or use the following method to get the images with high resolution.
Code: Select all
static void Main(string[] args)

        {

            Document document = new Document();

            document.LoadFromFile(@"..\..\Word.doc");

            Image[]images=

document.SaveToImages(Spire.Doc.Documents.ImageType.Metafile);

            for (int i = 0; i < images.Length; i++)

            {

                Metafile mf = images[i] as Metafile;

                Image newimage = ResetResolution(mf, 300);

                string outputfile = String.Format("image-{0}.tiff", i);

       newimage.Save(outputfile,System.Drawing.Imaging.ImageFormat.Tiff);

            }

        }

       public static Image ResetResolution(Metafile mf, float resolution)

        {

           int width = (int)(mf.Width * resolution / mf.HorizontalResolution);

            int height = (int)(mf.Height * resolution / mf.VerticalResolution);

            Bitmap bmp = new Bitmap(width, height);

            bmp.SetResolution(resolution, resolution);

            using (Graphics g = Graphics.FromImage(bmp))

            {

                g.DrawImage(mf, Point.Empty);

            }

            return bmp;

        }

In addition, sorry that at present there might be no solution to get the quality high enough for you, and we would improve it.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Mon Feb 16, 2015 3:12 pm

Hi,

Thanks for that... That works really great for Word documents, is there an equivalent we could use for PPTX? (the Presentation object doesn't seem to have the SaveToImages function)

john@screendragon.com
 
Posts: 2
Joined: Mon Dec 01, 2014 3:46 pm

Tue Feb 17, 2015 3:29 am

Hello,

Thanks for your response. Sorry that at present there is no equivalent method for pptx, there is no SaveToImages function in pptx.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.Presentation