PresentationBuilder cannot copy video slides correctly
Home › Forums › PresentationML › PresentationBuilder cannot copy video slides correctly
Tagged: PresentationBuilder
This topic contains 7 replies, has 3 voices, and was last updated by sliu 8 years, 5 months ago.
-
AuthorPosts
-
March 11, 2016 at 8:23 am #2511
I’m using Windows 10 and Office 2016. I just downloaded the latest OpenXml PowerTools and ran PresentationBuilder01. It works with the provided pptx files. I added 2 slides – one has audio (mp3) and the other has video (mp4). I modified the code to copy these 2 slides into a new pptx. After the file is generated, I tried to play the video. But it is not playable. The error is “Codec Unavailable”. I looked at the generated folder layout and media files. They are different from the source. Can you try to copy a video slide to see what the problem is.
Thanks in advance!!!
March 11, 2016 at 9:11 am #2512This certainly sounds like a bug. I’ll attend to this in the next week or so. Should not be hard to fix.
March 11, 2016 at 5:07 pm #2516Hi Eric,
That would be great! I’m new on OpenXml SDK. I’m reading PowerTool code. I see PtOpenXmlExtensions.GetXDocument and PutXDocument use OpenXmlPart.Annotation<XDocument> method to store part xml. I don’t fully understand its purpose. If all the parts have their annotations with different types, when the presentation is saved to pptx, can I see the annotations? Do they affect pptx rendering?
Thanks very much!!!
March 12, 2016 at 1:05 am #2525GetXDocument and PutXDocument are convenience functions that make it easier to work with LINQ to XML using the Open-Xml-Sdk. You can call GetXDocument multiple times and it will de-serialize it only once. The annotations are on the Open XML parts within a package. You can think of annotations as strongly-typed ‘user data’ for a part within a package.
Annotations are in-memory only. They have no affect on rendering.
March 12, 2016 at 4:59 pm #2529Thanks for the explanation.
After reading the code, I realized all the media files are created as DataPart in PresentationBuilder and the Non-Public memember TargetFileExtension is “.bin”. For images, OpenXml SDK adds .bin to media files. For audio and video files, it doesn’t add any extension. I know audios created by OpenXml SDK are playable, but not video. I’m not sure if it is caused by file extension. I thought using OpenXm SDK I can create exactly folder layouts as pptx generated by PowerPoint. It seems like not exactly.
I’m wondering how [Content_Type].xml is created by sdk. Which sdk api or part is related to its generation? Can I load in this xml and modify it and save it back to some part. When package is saved, my modified content is in [Content_Type].xml?
March 12, 2016 at 10:49 pm #2531No, you can’t create folder layout exactly as generated by PowerPoint. But it should not matter.
[Content_Type].xml is created implicitly by System.IO.Packaging when you create a package. When you maintain a package, adding parts, you specify the content type, and System.IO.Packaging will add new entries into [Content_Type].xml. You should never need to maintain this explicitly.
June 16, 2016 at 7:40 pm #3495PresentationBuilder cannot copy video slides correctly, could you plz help us.
June 16, 2016 at 9:29 pm #3496This issue has been resolved. How do I help?
-
AuthorPosts
You must be logged in to reply to this topic.