Comments (2)
Sorry for the answer delay.
Such feature is not available yet. We will take a look.
from shapecrawler.
Given a slidepart, and using DocumentFormat.OpenXml.Presentation;, I used brute force, but I could not determine the audio duration accurately so set it to indefinite:
IEnumerable<DocumentFormat.OpenXml.Presentation.Timing> animationTimings = slidePart.Slide.Descendants<DocumentFormat.OpenXml.Presentation.Timing>();
foreach (DocumentFormat.OpenXml.Presentation.Timing animationTiming in animationTimings)
{
animationTiming.Remove();
//^ Remove any pre-existing slide animations
}
var slide = slidePart.Slide;
string timing = @"<p:timing xmlns:p=""http://schemas.openxmlformats.org/presentationml/2006/main""><p:tnLst><p:par><p:cTn id=""1"" dur=""indefinite"" restart=""never"" nodeType=""tmRoot""><p:childTnLst><p:seq concurrent=""1"" nextAc=""seek""><p:cTn id=""2"" dur=""indefinite"" nodeType=""mainSeq""><p:childTnLst><p:par><p:cTn id=""3"" fill=""hold""><p:stCondLst><p:cond delay=""indefinite""/><p:cond evt=""onBegin"" delay=""0""><p:tn val=""2""/></p:cond></p:stCondLst><p:childTnLst><p:par><p:cTn id=""4"" fill=""hold""><p:stCondLst><p:cond delay=""0""/></p:stCondLst><p:childTnLst><p:par><p:cTn id=""5"" presetID=""1"" presetClass=""mediacall"" presetSubtype=""0"" fill=""hold"" nodeType=""withEffect""><p:stCondLst><p:cond delay=""2000""/></p:stCondLst><p:childTnLst><p:cmd type=""call"" cmd=""playFrom(0.0)""><p:cBhvr><p:cTn id=""6"" dur=""indefinite"" fill=""hold""/><p:tgtEl><p:spTgt spid=""4""/></p:tgtEl></p:cBhvr></p:cmd></p:childTnLst></p:cTn></p:par></p:childTnLst></p:cTn></p:par></p:childTnLst></p:cTn></p:par></p:childTnLst></p:cTn><p:prevCondLst><p:cond evt=""onPrev"" delay=""0""><p:tgtEl><p:sldTgt/></p:tgtEl></p:cond></p:prevCondLst><p:nextCondLst><p:cond evt=""onNext"" delay=""0""><p:tgtEl><p:sldTgt/></p:tgtEl></p:cond></p:nextCondLst></p:seq><p:audio><p:cMediaNode vol=""80000""><p:cTn id=""7"" display=""0""><p:stCondLst><p:cond delay=""indefinite""/></p:stCondLst><p:endCondLst><p:cond evt=""onStopAudio"" delay=""0""><p:tgtEl><p:sldTgt/></p:tgtEl></p:cond></p:endCondLst></p:cTn><p:tgtEl><p:spTgt spid=""4""/></p:tgtEl></p:cMediaNode></p:audio></p:childTnLst></p:cTn></p:par></p:tnLst></p:timing>";
//^ For id=""6"", the dur has been set to ""indefinite"", rather than the duration of the audio.
XElement xElt = XElement.Parse(timing, LoadOptions.PreserveWhitespace);
var newChild = new DocumentFormat.OpenXml.Presentation.Timing(timing);
slide.AddChild(newChild);
from shapecrawler.
Related Issues (20)
- Automatically playback audio
- How to set background image HOT 1
- Copying a slide with the code in wiki,results in a proportionally smaller slide HOT 3
- How should I create a blank slide HOT 1
- Add a `Path` property to store shape's info
- slide show
- Create NuGet package from master branch
- Incorrect x, y, width and height in child shape of GroupShape HOT 2
- Net Framework 4.7.2 not supported in new versions HOT 3
- System.InvalidOperationException: 'Sequence contains no matching element' HOT 2
- Copy slide Note
- Error while saving, Framework 4.7.2 HOT 2
- Insert Object
- Text Vertical Alignment HOT 1
- How to remove a Shape? HOT 1
- [Bug] - Not recognizing table template when editing pptx at `.AsTable()` HOT 2
- Using ShapeCrawler in .Net Framework project (a VSTO addin) HOT 3
- Integrate ShapeCrawler with OpenXML SDK HOT 3
- BUG report: update text of shape changes the font size
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shapecrawler.