public static ThemePart CreateTheme(SlideMasterPart slideMasterPart1) { ThemePart themePart1 = slideMasterPart1.AddNewPart <ThemePart>("rId12"); GeneratePartContent(themePart1); return(themePart1); }
private static ThemePart CreateTheme(SlideMasterPart slideMasterPart1) { ThemePart themePart1 = slideMasterPart1.AddNewPart <ThemePart>("rId5"); D.Theme theme1 = new D.Theme() { Name = "Office Theme" }; D.ThemeElements themeElements1 = new D.ThemeElements( new D.ColorScheme( new D.Dark1Color(new D.SystemColor() { Val = D.SystemColorValues.WindowText, LastColor = "000000" }), new D.Light1Color(new D.SystemColor() { Val = D.SystemColorValues.Window, LastColor = "FFFFFF" }), new D.Dark2Color(new D.RgbColorModelHex() { Val = "1F497D" }), new D.Light2Color(new D.RgbColorModelHex() { Val = "EEECE1" }), new D.Accent1Color(new D.RgbColorModelHex() { Val = "4F81BD" }), new D.Accent2Color(new D.RgbColorModelHex() { Val = "C0504D" }), new D.Accent3Color(new D.RgbColorModelHex() { Val = "9BBB59" }), new D.Accent4Color(new D.RgbColorModelHex() { Val = "8064A2" }), new D.Accent5Color(new D.RgbColorModelHex() { Val = "4BACC6" }), new D.Accent6Color(new D.RgbColorModelHex() { Val = "F79646" }), new D.Hyperlink(new D.RgbColorModelHex() { Val = "0000FF" }), new D.FollowedHyperlinkColor(new D.RgbColorModelHex() { Val = "800080" })) { Name = "Office" }, new D.FontScheme( new D.MajorFont( new D.LatinFont() { Typeface = "Calibri" }, new D.EastAsianFont() { Typeface = "" }, new D.ComplexScriptFont() { Typeface = "" }), new D.MinorFont( new D.LatinFont() { Typeface = "Calibri" }, new D.EastAsianFont() { Typeface = "" }, new D.ComplexScriptFont() { Typeface = "" })) { Name = "Office" }, new D.FormatScheme( new D.FillStyleList( new D.SolidFill(new D.SchemeColor() { Val = D.SchemeColorValues.PhColor }), new D.GradientFill( new D.GradientStopList( new D.GradientStop(new D.SchemeColor(new D.Tint() { Val = 50000 }, new D.SaturationModulation() { Val = 300000 }) { Val = D.SchemeColorValues.PhColor }) { Position = 0 }, new D.GradientStop(new D.SchemeColor(new D.Tint() { Val = 37000 }, new D.SaturationModulation() { Val = 300000 }) { Val = D.SchemeColorValues.PhColor }) { Position = 35000 }, new D.GradientStop(new D.SchemeColor(new D.Tint() { Val = 15000 }, new D.SaturationModulation() { Val = 350000 }) { Val = D.SchemeColorValues.PhColor }) { Position = 100000 } ), new D.LinearGradientFill() { Angle = 16200000, Scaled = true }), new D.NoFill(), new D.PatternFill(), new D.GroupFill()), new D.LineStyleList( new D.Outline( new D.SolidFill( new D.SchemeColor( new D.Shade() { Val = 95000 }, new D.SaturationModulation() { Val = 105000 }) { Val = D.SchemeColorValues.PhColor }), new D.PresetDash() { Val = D.PresetLineDashValues.Solid }) { Width = 9525, CapType = D.LineCapValues.Flat, CompoundLineType = D.CompoundLineValues.Single, Alignment = D.PenAlignmentValues.Center }, new D.Outline( new D.SolidFill( new D.SchemeColor( new D.Shade() { Val = 95000 }, new D.SaturationModulation() { Val = 105000 }) { Val = D.SchemeColorValues.PhColor }), new D.PresetDash() { Val = D.PresetLineDashValues.Solid }) { Width = 9525, CapType = D.LineCapValues.Flat, CompoundLineType = D.CompoundLineValues.Single, Alignment = D.PenAlignmentValues.Center }, new D.Outline( new D.SolidFill( new D.SchemeColor( new D.Shade() { Val = 95000 }, new D.SaturationModulation() { Val = 105000 }) { Val = D.SchemeColorValues.PhColor }), new D.PresetDash() { Val = D.PresetLineDashValues.Solid }) { Width = 9525, CapType = D.LineCapValues.Flat, CompoundLineType = D.CompoundLineValues.Single, Alignment = D.PenAlignmentValues.Center }), new D.EffectStyleList( new D.EffectStyle( new D.EffectList( new D.OuterShadow( new D.RgbColorModelHex( new D.Alpha() { Val = 38000 }) { Val = "000000" }) { BlurRadius = 40000L, Distance = 20000L, Direction = 5400000, RotateWithShape = false })), new D.EffectStyle( new D.EffectList( new D.OuterShadow( new D.RgbColorModelHex( new D.Alpha() { Val = 38000 }) { Val = "000000" }) { BlurRadius = 40000L, Distance = 20000L, Direction = 5400000, RotateWithShape = false })), new D.EffectStyle( new D.EffectList( new D.OuterShadow( new D.RgbColorModelHex( new D.Alpha() { Val = 38000 }) { Val = "000000" }) { BlurRadius = 40000L, Distance = 20000L, Direction = 5400000, RotateWithShape = false }))), new D.BackgroundFillStyleList( new D.SolidFill(new D.SchemeColor() { Val = D.SchemeColorValues.PhColor }), new D.GradientFill( new D.GradientStopList( new D.GradientStop( new D.SchemeColor(new D.Tint() { Val = 50000 }, new D.SaturationModulation() { Val = 300000 }) { Val = D.SchemeColorValues.PhColor }) { Position = 0 }, new D.GradientStop( new D.SchemeColor(new D.Tint() { Val = 50000 }, new D.SaturationModulation() { Val = 300000 }) { Val = D.SchemeColorValues.PhColor }) { Position = 0 }, new D.GradientStop( new D.SchemeColor(new D.Tint() { Val = 50000 }, new D.SaturationModulation() { Val = 300000 }) { Val = D.SchemeColorValues.PhColor }) { Position = 0 }), new D.LinearGradientFill() { Angle = 16200000, Scaled = true }), new D.GradientFill( new D.GradientStopList( new D.GradientStop( new D.SchemeColor(new D.Tint() { Val = 50000 }, new D.SaturationModulation() { Val = 300000 }) { Val = D.SchemeColorValues.PhColor }) { Position = 0 }, new D.GradientStop( new D.SchemeColor(new D.Tint() { Val = 50000 }, new D.SaturationModulation() { Val = 300000 }) { Val = D.SchemeColorValues.PhColor }) { Position = 0 }), new D.LinearGradientFill() { Angle = 16200000, Scaled = true }))) { Name = "Office" }); theme1.Append(themeElements1); theme1.Append(new D.ObjectDefaults()); theme1.Append(new D.ExtraColorSchemeList()); themePart1.Theme = theme1; return(themePart1); }
private void CreateParts(PresentationDocument document, PresentationGenerationData data) { ExtendedFilePropertiesPart extendedFilePropertiesPart1 = document.AddNewPart <ExtendedFilePropertiesPart>("rId3"); GenerateExtendedFilePropertiesPartHelper.GenerateExtendedFilePropertiesPart1Content(extendedFilePropertiesPart1); PresentationPart presentationPart1 = document.AddPresentationPart(); GeneratePresentationPartHelper.GeneratePresentationPart1Content(presentationPart1); CommentAuthorsPart commentAuthorsPart1 = presentationPart1.AddNewPart <CommentAuthorsPart>("rId8"); GenerateCommentAuthorsPartHelper.GenerateCommentAuthorsPart1Content(commentAuthorsPart1); CustomXmlPart customXmlPart1 = presentationPart1.AddNewPart <CustomXmlPart>("application/xml", "rId3"); GenerateCustomXmlPartHelper.GenerateCustomXmlPart1Content(customXmlPart1); CustomXmlPropertiesPart customXmlPropertiesPart1 = customXmlPart1.AddNewPart <CustomXmlPropertiesPart>("rId1"); GenerateCustomXmlPropertiesPartHelper.GenerateCustomXmlPropertiesPart1Content(customXmlPropertiesPart1); HandoutMasterPart handoutMasterPart1 = presentationPart1.AddNewPart <HandoutMasterPart>("rId7"); GenerateHandoutMasterPartHelper.GenerateHandoutMasterPart1Content(handoutMasterPart1); ThemePart themePart1 = handoutMasterPart1.AddNewPart <ThemePart>("rId1"); GenerateThemePartHelper.GenerateThemePart1Content(themePart1); TableStylesPart tableStylesPart1 = presentationPart1.AddNewPart <TableStylesPart>("rId12"); GenerateTableStylesPartHelper.GenerateTableStylesPart1Content(tableStylesPart1); CustomXmlPart customXmlPart2 = presentationPart1.AddNewPart <CustomXmlPart>("application/xml", "rId2"); GenerateCustomXmlPartHelper.GenerateCustomXmlPart2Content(customXmlPart2); CustomXmlPropertiesPart customXmlPropertiesPart2 = customXmlPart2.AddNewPart <CustomXmlPropertiesPart>("rId1"); GenerateCustomXmlPropertiesPartHelper.GenerateCustomXmlPropertiesPart2Content(customXmlPropertiesPart2); CustomXmlPart customXmlPart3 = presentationPart1.AddNewPart <CustomXmlPart>("application/xml", "rId1"); GenerateCustomXmlPartHelper.GenerateCustomXmlPart3Content(customXmlPart3); CustomXmlPropertiesPart customXmlPropertiesPart3 = customXmlPart3.AddNewPart <CustomXmlPropertiesPart>("rId1"); GenerateCustomXmlPropertiesPartHelper.GenerateCustomXmlPropertiesPart3Content(customXmlPropertiesPart3); NotesMasterPart notesMasterPart1 = presentationPart1.AddNewPart <NotesMasterPart>("rId6"); GenerateNotesMasterPartHelper.GenerateNotesMasterPart1Content(notesMasterPart1); ThemePart themePart2 = notesMasterPart1.AddNewPart <ThemePart>("rId1"); GenerateThemePartHelper.GenerateThemePart2Content(themePart2); ThemePart themePart3 = presentationPart1.AddNewPart <ThemePart>("rId11"); GenerateThemePartHelper.GenerateThemePart3Content(themePart3); SlidePart slidePart1 = presentationPart1.AddNewPart <SlidePart>("rId5"); GenerateSlidePartHelper.GenerateSlidePart1Content(slidePart1, data); var pictureType = string.Empty; if (!string.IsNullOrEmpty(data.PictureType)) { pictureType = data.PictureType; } else { pictureType = "image/png"; } ImagePart imagePart1 = slidePart1.AddNewPart <ImagePart>(pictureType, "rId3"); GenerateImagePartHelper.GenerateImagePart1Content(imagePart1, data.PictureContent); NotesSlidePart notesSlidePart1 = slidePart1.AddNewPart <NotesSlidePart>("rId2"); GenerateNotesSlidePartHelper.GenerateNotesSlidePart1Content(notesSlidePart1); notesSlidePart1.AddPart(slidePart1, "rId2"); notesSlidePart1.AddPart(notesMasterPart1, "rId1"); SlideLayoutPart slideLayoutPart1 = slidePart1.AddNewPart <SlideLayoutPart>("rId1"); GenerateSlideLayoutPartHelper.GenerateSlideLayoutPart1Content(slideLayoutPart1); SlideMasterPart slideMasterPart1 = slideLayoutPart1.AddNewPart <SlideMasterPart>("rId1"); GenerateSlideMasterPartHelper.GenerateSlideMasterPart1Content(slideMasterPart1); SlideLayoutPart slideLayoutPart2 = slideMasterPart1.AddNewPart <SlideLayoutPart>("rId8"); GenerateSlideLayoutPartHelper.GenerateSlideLayoutPart2Content(slideLayoutPart2); slideLayoutPart2.AddPart(slideMasterPart1, "rId1"); ImagePart imagePart2 = slideMasterPart1.AddNewPart <ImagePart>("image/jpeg", "rId13"); GenerateImagePartHelper.GenerateImagePart2Content(imagePart2); SlideLayoutPart slideLayoutPart3 = slideMasterPart1.AddNewPart <SlideLayoutPart>("rId3"); GenerateSlideLayoutPartHelper.GenerateSlideLayoutPart3Content(slideLayoutPart3); slideLayoutPart3.AddPart(slideMasterPart1, "rId1"); SlideLayoutPart slideLayoutPart4 = slideMasterPart1.AddNewPart <SlideLayoutPart>("rId7"); GenerateSlideLayoutPartHelper.GenerateSlideLayoutPart4Content(slideLayoutPart4); slideLayoutPart4.AddPart(slideMasterPart1, "rId1"); slideMasterPart1.AddPart(themePart3, "rId12"); slideMasterPart1.AddPart(slideLayoutPart1, "rId2"); SlideLayoutPart slideLayoutPart5 = slideMasterPart1.AddNewPart <SlideLayoutPart>("rId1"); GenerateSlideLayoutPartHelper.GenerateSlideLayoutPart5Content(slideLayoutPart5); ImagePart imagePart3 = slideLayoutPart5.AddNewPart <ImagePart>("image/jpeg", "rId3"); GenerateImagePartHelper.GenerateImagePart3Content(imagePart3); ImagePart imagePart4 = slideLayoutPart5.AddNewPart <ImagePart>("image/png", "rId2"); GenerateImagePartHelper.GenerateImagePart4Content(imagePart4); slideLayoutPart5.AddPart(slideMasterPart1, "rId1"); SlideLayoutPart slideLayoutPart6 = slideMasterPart1.AddNewPart <SlideLayoutPart>("rId6"); GenerateSlideLayoutPartHelper.GenerateSlideLayoutPart6Content(slideLayoutPart6); slideLayoutPart6.AddPart(slideMasterPart1, "rId1"); SlideLayoutPart slideLayoutPart7 = slideMasterPart1.AddNewPart <SlideLayoutPart>("rId11"); GenerateSlideLayoutPartHelper.GenerateSlideLayoutPart7Content(slideLayoutPart7); slideLayoutPart7.AddPart(slideMasterPart1, "rId1"); SlideLayoutPart slideLayoutPart8 = slideMasterPart1.AddNewPart <SlideLayoutPart>("rId5"); GenerateSlideLayoutPartHelper.GenerateSlideLayoutPart8Content(slideLayoutPart8); slideLayoutPart8.AddPart(slideMasterPart1, "rId1"); SlideLayoutPart slideLayoutPart9 = slideMasterPart1.AddNewPart <SlideLayoutPart>("rId10"); GenerateSlideLayoutPartHelper.GenerateSlideLayoutPart9Content(slideLayoutPart9); slideLayoutPart9.AddPart(slideMasterPart1, "rId1"); SlideLayoutPart slideLayoutPart10 = slideMasterPart1.AddNewPart <SlideLayoutPart>("rId4"); GenerateSlideLayoutPartHelper.GenerateSlideLayoutPart10Content(slideLayoutPart10); slideLayoutPart10.AddPart(slideMasterPart1, "rId1"); SlideLayoutPart slideLayoutPart11 = slideMasterPart1.AddNewPart <SlideLayoutPart>("rId9"); GenerateSlideLayoutPartHelper.GenerateSlideLayoutPart11Content(slideLayoutPart11); slideLayoutPart11.AddPart(slideMasterPart1, "rId1"); ViewPropertiesPart viewPropertiesPart1 = presentationPart1.AddNewPart <ViewPropertiesPart>("rId10"); GenerateViewPropertiesPartHelper.GenerateViewPropertiesPart1Content(viewPropertiesPart1); presentationPart1.AddPart(slideMasterPart1, "rId4"); PresentationPropertiesPart presentationPropertiesPart1 = presentationPart1.AddNewPart <PresentationPropertiesPart>("rId9"); GeneratePresentationPropertiesPartHelper.GeneratePresentationPropertiesPart1Content(presentationPropertiesPart1); CustomFilePropertiesPart customFilePropertiesPart1 = document.AddNewPart <CustomFilePropertiesPart>("rId4"); CustomFilePropertiesPartHelper.GenerateCustomFilePropertiesPart1Content(customFilePropertiesPart1); SetPackageProperties(document); }