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.

Sat Dec 09, 2017 6:15 am

Is it possible to convert slide to stream and forth back. I need to create a presentation by reading multiple presentation, reading all presentation and taking the need slide from it seems like a performance issue, If I had slides stored as stream I can take only the required one and generate my ppt.

Donpp
 
Posts: 7
Joined: Tue Dec 05, 2017 1:33 pm

Mon Dec 11, 2017 2:54 am

Hello,

Thanks for your inquiry.
Sorry there's no direct way to save a slide to stream, but you could copy the slide to a new document and then save the new document to stream. Please refer to the code below.
Code: Select all
           //load the original presentation
            Presentation presentation = new Presentation();
            string input = @"input.pptx";
            presentation.LoadFromFile(input);

            //create a new one and set the size
            Presentation newOne = new Presentation();
            float width = presentation.SlideSize.Size.Width;
            float height = presentation.SlideSize.Size.Height;
            newOne.SetPageSize(width, height, false);

            //copy the slide you need to the new document
            newOne.Slides.Append(presentation.Slides[0]);

            //save to stream.
            using (MemoryStream ms = new MemoryStream())
            {
                newOne.SaveToFile(ms, FileFormat.Pptx2010);
            }


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Dec 11, 2017 3:02 pm

Thank you,

I found another issue, I was reading a slide from one ppt file and creating another. But one slide which has GIF file has been added to new presentation file as png image. Do you have any idea why this happens ?

Donpp
 
Posts: 7
Joined: Tue Dec 05, 2017 1:33 pm

Tue Dec 12, 2017 1:40 am

Hello,

Thanks for the quick response.
After an initial test with the latest hotfix(Spire.Presentation Pack Hotfix Version:2.8.59), I didn't reproduce the issue you mentioned. Please upgrade your dlls and check it again.
If the issue still happens, please send your sample ppt file together with the code to us(support@e-iceblue.com), then we will look into it.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Tue Dec 12, 2017 7:09 am

Thank you for your response, Please find the attached ppt, first and forth slide has animated GIF, when I tried to create a presentation by reading those slides. The presentation created successfully and if I tried to open it, MS ppt is not responding.

If I tried to create ppt only with forth slide it opens in MS ppt but the GIF image does not works.
if I tried to create ppt only with first slide it opens in MS ppt but the GIF image does not works.

if I tried to create a ppt with first and forth slide on it , the file is not responding. it only happens if I add the first as first and forth as second.

Code: Select all
var userid = Request.QueryString["id"];
        if (userid != null)
        {
            DataCommand command = new DataCommand("getActiveSlides");
            command.Add("userid", userid);

            DataSet ds = (DataSet)command.Execute(true);
            DataTable dt = ds.Tables[0];
            Presentation newP = new Presentation();
            Presentation helper = new Presentation();
            var pname = "";

            foreach (DataRow dr in dt.Rows)
            {
                var presentationName = dr["presentationid"].ToString() + dr["type"].ToString();
                Int32 slideIndex = Convert.ToInt32(dr["slideindex"].ToString());
                Int32 orderNumber = Convert.ToInt32(dr["ordernumber"].ToString());
                //if(pname !=  presentationName) {
                helper.LoadFromFile(Server.MapPath("~/Uploads/" + presentationName)); //loading ppt file
                    pname = presentationName;
                //}
                ISlide orgSlide = helper.Slides[slideIndex]; // reading the slide
                newP.Slides.Insert(orderNumber, orgSlide); // inserting in to new ppt
            }

            Byte[] Content = newP.GetBytes();

            Response.ContentType = "application/octet-stream";
            Response.AddHeader("content-disposition", "attachment; filename=presentation.ppt");
            Response.BufferOutput = true;
            Response.OutputStream.Write(Content, 0, Content.Length);
            Response.End(); //downloading it
        }
You do not have the required permissions to view the files attached to this post.

Donpp
 
Posts: 7
Joined: Tue Dec 05, 2017 1:33 pm

Tue Dec 12, 2017 8:03 am

Hello,

Thanks for your response.
I have reproduced the issue and referred it to our dev team. Once there's any update, I will let you know.
Sorry for the inconvenience caused.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Tue Dec 12, 2017 12:23 pm

Thank you so much, Let me know if there is a workaround or something. And keep me posted once the issue is fixed.

Donpp
 
Posts: 7
Joined: Tue Dec 05, 2017 1:33 pm

Wed Dec 13, 2017 1:18 am

Hello Donpp,

Thanks for your reply.
I will definitely notify you when the hotfix is available. :)

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Dec 13, 2017 7:09 am

Hi Jane,

Sorry to bug you again,

I have attached a ppt, In that slide 9 has different animations added to different text element. if I try to insert that slide into new ppt. it adds the slides but the animation added to different text altogether added to all the text, as the result all the text displays multiple times with different animation.

We are working on a product where the animation should go as it is. Could you help with this.

Thank you
You do not have the required permissions to view the files attached to this post.

Donpp
 
Posts: 7
Joined: Tue Dec 05, 2017 1:33 pm

Wed Dec 13, 2017 8:11 am

Hello Donpp,

Thanks for your post.
I have noticed the issue and logged it in our bug tracking system.
Once there's any progress or update, I will inform you.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Thu Dec 14, 2017 1:58 am

Hi Jane,

Do you have an ETA, or approximate fix release date, we planing to launch our product this month end. it would be great if I get a date.

Donpp
 
Posts: 7
Joined: Tue Dec 05, 2017 1:33 pm

Thu Dec 14, 2017 6:58 am

Hello Donpp,

Thanks for contacting us.
We do understand your situation, however, I am afraid, at the moment we can't provide you the ETA since the problem is very complex and more time is needed for analysis.
Thanks for your understanding.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Jan 08, 2018 7:06 am

Hi Guys,

Do I have any update ? Are we close ?

Donpp
 
Posts: 7
Joined: Tue Dec 05, 2017 1:33 pm

Mon Jan 08, 2018 9:40 am

Hello Donpp,

Thanks for contacting us.
We are almost there except for one major issue. During the investigation, we found the generated file could be open by any office version except for 2013. Never mind, our dev team will continue looking for the approaches. Once there's any good news, I will let you know.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Jan 12, 2018 10:00 am

Hello,

Glad to inform the hotfix(Spire.Presentation Pack Hotfix Version:2.8.95) is available now. The fix issues are as below.
1. gif format becomes .png after copying the slide.
2. The wrong animation effect on page 9.
Just kindly note one thing. The generated file could be open by any office version except for 2013. In that case, If you are using the PowerPoint2013, we suggest you open the result file in another PowerPoint version. We will keep looking for the solutions to that issue.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.Presentation