private static void AddResourcesOutput(Presentation pres, WebDocument document, bool embedImages) { document.AddEmbeddedFontsOutput(document.Global.Get <string>("fontsPath"), pres); document.AddVideoOutput(document.Global.Get <string>("mediaPath"), pres); if (!embedImages) { string imagesPath = document.Global.Get <string>("imagesPath"); document.AddImagesOutput(imagesPath, pres); document.AddShapeAsImagesOutput <Chart>(imagesPath, pres); document.AddShapeAsImagesOutput <SmartArt>(imagesPath, pres); document.AddShapeAsImagesOutput <AutoShape>(imagesPath, pres); document.AddShapeAsImagesOutput <Connector>(imagesPath, pres); document.AddShapeAsImagesOutput <GroupShape>(imagesPath, pres); } }
public static void AddCommonInputOutput(this WebDocument document, WebDocumentOptions options, string templatesPath, string outputPath, Presentation pres) { string stylesPath = document.Global.Get <string>("stylesPath"); string scriptsPath = document.Global.Get <string>("scriptsPath"); document.Input.AddTemplate <Presentation>("styles-pres", Path.Combine(templatesPath, @"styles\pres.css")); document.Input.AddTemplate <MasterSlide>("styles-master", Path.Combine(templatesPath, @"styles\master.css")); document.Input.AddTemplate <Presentation>("scripts-animation", Path.Combine(templatesPath, @"scripts\animation.js")); document.Input.AddTemplate <Presentation>("scripts-effects", Path.Combine(templatesPath, @"scripts\effects.js")); document.Input.AddTemplate <Presentation>("scripts-navigation", Path.Combine(templatesPath, @"scripts\navigation.js")); document.Input.AddTemplate <Presentation>("index", Path.Combine(templatesPath, "index.html")); document.Input.AddTemplate <Slide>("slide", Path.Combine(templatesPath, "slide.html")); document.Input.AddTemplate <AutoShape>("autoshape", Path.Combine(templatesPath, "autoshape.html")); document.Input.AddTemplate <TextFrame>("textframe", Path.Combine(templatesPath, "textframe.html")); document.Input.AddTemplate <Paragraph>("paragraph", Path.Combine(templatesPath, "paragraph.html")); document.Input.AddTemplate <Paragraph>("bullet", Path.Combine(templatesPath, "bullet.html")); document.Input.AddTemplate <Portion>("portion", Path.Combine(templatesPath, "portion.html")); document.Input.AddTemplate <VideoFrame>("videoframe", Path.Combine(templatesPath, "videoframe.html")); document.Input.AddTemplate <PictureFrame>("pictureframe", Path.Combine(templatesPath, "pictureframe.html")); document.Input.AddTemplate <Table>("table", Path.Combine(templatesPath, "table.html")); document.Input.AddTemplate <Shape>("shape", Path.Combine(templatesPath, "shape.html")); document.Output.Add(Path.Combine(outputPath, "index.html"), "index", pres); document.Output.Add(Path.Combine(stylesPath, "pres.css"), "styles-pres", pres); document.Output.Add(Path.Combine(stylesPath, "master.css"), "styles-master", (MasterSlide)pres.Masters[0]); document.Output.Add(Path.Combine(scriptsPath, "animation.js"), "scripts-animation", pres); document.Output.Add(Path.Combine(scriptsPath, "effects.js"), "scripts-effects", pres); document.Output.Add(Path.Combine(scriptsPath, "navigation.js"), "scripts-navigation", pres); document.AddEmbeddedFontsOutput(document.Global.Get <string>("fontsPath"), pres); document.AddVideoOutput(document.Global.Get <string>("mediaPath"), pres); if (!options.EmbedImages) { string imagesPath = document.Global.Get <string>("imagesPath"); document.AddImagesOutput(imagesPath, pres); document.AddShapeAsImagesOutput <Chart>(imagesPath, pres); document.AddShapeAsImagesOutput <SmartArt.SmartArt>(imagesPath, pres); document.AddShapeAsImagesOutput <AutoShape>(imagesPath, pres); document.AddShapeAsImagesOutput <Connector>(imagesPath, pres); document.AddShapeAsImagesOutput <GroupShape>(imagesPath, pres); } }