Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Wed Jun 10, 2015 6:58 am

I want to get the thumbs of each slide using spire.presentation,the code is below

//Spire.Presentation.Presentation P = new Spire.Presentation.Presentation();

//P.LoadFromFile(Server.MapPath(Z.DownloadUrl),Spire.Presentation.FileFormat.Auto);
//List<byte[]> PImages = new List<byte[]>();

////int i = 0;
////foreach (Spire.Presentation.ISlide s in P.Slides)
////{
// //i++;
// //if (i >= 4)
// //{ break; }
// MemoryStream ms = new MemoryStream();
// //P.Slides[0].SaveAsImage(210,150).Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
// byte[] b = new byte[ms.Length];
// ms.Position = 0;
// ms.Read(b, 0, (int)ms.Length);
// ms.Dispose();

// PImages.Add(b);
////}

//P.Dispose();

it can work,but the memory increase quickly once the method "loadfromfile" is to be excute.

thank you for your good working.

jick1978
 
Posts: 4
Joined: Mon Dec 01, 2014 4:04 pm

Wed Jun 10, 2015 9:31 am

Hello,

Thanks for your inquiry.
Please provide your sample document for our test here, or you can send it to us(support@e-iceblue.com) via email.

Best Regards,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Fri Jun 12, 2015 4:01 am

all code is below,thanks

Spire.Presentation.Presentation P = new Spire.Presentation.Presentation();

P.LoadFromFile(myfilename,Spire.Presentation.FileFormat.Auto);
List<byte[]> PImages = new List<byte[]>();

foreach (Spire.Presentation.ISlide s in P.Slides)
{
MemoryStream ms = new MemoryStream();
//P.Slides[0].SaveAsImage(210,150).Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
byte[] b = new byte[ms.Length];
ms.Position = 0;
ms.Read(b, 0, (int)ms.Length);
ms.Dispose();

PImages.Add(b);
}

P.Dispose();

the server is windows 2008 r2 x64

jick1978
 
Posts: 4
Joined: Mon Dec 01, 2014 4:04 pm

Fri Jun 12, 2015 10:07 am

Hello,

Thanks for sharing all code and system information. I have tested a sample document with your code, and didn't find the memory issue you mentioned. Please share the sample document which occurs the memory increase quickly issue.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.Presentation