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.

Tue Feb 09, 2021 7:59 am

Hi Team,

I am getting error while doing ppt.Slides[0].Shapes.AppendVideoMedia(myfileBloburl, new RectangleF(505,253,240,140)); And the error is as below:
The filename, directory name, or volume label syntax is incorrect. : 'C:\\<solutionpath>\\<myfileBloburl>'


Thanks in advance for your support.
Here is my code.

string blobFileUrl = bloburl (Eg: http://dummyrul.com//dummyFolder//dummyVideo.mp4)

Presentation ppt = new Presentation();
ppt.LoadFromStream(streamUrl, FileFormat.Pptx2013);
ISlide slide = ppt.Slides[0];
ppt.Slides[0].Shapes.AppendVideoMedia(blobFileUrl, new RectangleF(505,253,240,140));

- Here, when calling .AppendVideoMedia method, i'm getting error as 'The filename, directory name, or volume label syntax is incorrect. : 'C:\\<solutionpath>\\<destinationPath>'

saleembaigmirza
 
Posts: 21
Joined: Fri Nov 13, 2020 4:15 pm

Tue Feb 09, 2021 8:36 am

Hello,

Thanks for your inquiry.
Sorry that our Spire.Presentation supports appending local video files, but does not support appending online video files.
Please download your video file first, and then use our Spire.Presentation to append it to the PPT file, like the code below.
Code: Select all
            string blobFileUrl = "http://dummyrul.com//dummyFolder//dummyVideo.mp4";
            string localPath = "video.mp4";
            WebClient webClient = new WebClient();
            webClient.DownloadFile(blobFileUrl, localPath);
            Presentation ppt = new Presentation();
            ppt.LoadFromStream(streamUrl, FileFormat.Pptx2013);
            ISlide slide = ppt.Slides[0];
            ppt.Slides[0].Shapes.AppendVideoMedia(localPath, new RectangleF(505, 253, 240, 140));
            ppt.SaveToFile("result.pptx",FileFormat.Pptx2013);


Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Presentation

cron