Esempio n. 1
0
        public void MergePresentationsSlides(string sourceFolderLocation, string sourcePresentation, string destinationFolderLocation, string destPresentation)
        {
            int id = 0;

            // Open Destination presentation
            using (PresentationDocument myDestDeck = PresentationDocument.Open(destinationFolderLocation + destPresentation, true))
            {
                PresentationPart destPresPart = myDestDeck.PresentationPart;

                if (destPresPart.Presentation.SlideIdList == null)
                {
                    destPresPart.Presentation.SlideIdList = new SlideIdList();
                }
                // Open source presentation
                using (PresentationDocument mySourceDeck = PresentationDocument.Open(sourceFolderLocation + sourcePresentation, false))
                {
                    PresentationPart sourcePresPart = mySourceDeck.PresentationPart;

                    uint uniqueId   = GetMaxSlideMasterId(destPresPart.Presentation.SlideMasterIdList);
                    uint maxSlideId = GetMaxSlideId(destPresPart.Presentation.SlideIdList);

                    foreach (SlideId slideId in sourcePresPart.Presentation.SlideIdList)
                    {
                        SlidePart       sp;
                        SlidePart       destSp;
                        SlideMasterPart destMasterPart;
                        string          relId;
                        SlideMasterId   newSlideMasterId;
                        SlideId         newSlideId;

                        id++;
                        sp             = (SlidePart)sourcePresPart.GetPartById(slideId.RelationshipId);
                        relId          = sourcePresentation.Remove(sourcePresentation.IndexOf('.')) + id;
                        destSp         = destPresPart.AddPart <SlidePart>(sp, relId);
                        destMasterPart = destSp.SlideLayoutPart.SlideMasterPart;
                        destPresPart.AddPart(destMasterPart);

                        uniqueId++;
                        newSlideMasterId = new SlideMasterId();
                        newSlideMasterId.RelationshipId = destPresPart.GetIdOfPart(destMasterPart);
                        newSlideMasterId.Id             = uniqueId;

                        maxSlideId++;
                        newSlideId = new SlideId();
                        newSlideId.RelationshipId = relId;
                        newSlideId.Id             = maxSlideId;
                        destPresPart.Presentation.SlideMasterIdList.Append(newSlideMasterId);
                        destPresPart.Presentation.SlideIdList.Append(newSlideId);


                        FixSlideLayoutIds(destPresPart, ref uniqueId);
                    }
                    destPresPart.Presentation.Save();
                }
            }
        }
Esempio n. 2
0
        private static void CreatePresentationParts(PresentationPart presentationPart)
        {
            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId1"
            });
            SlideIdList slideIdList1 = new SlideIdList(new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = "rId2"
            });
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cx = 6858000, Cy = 9144000
            };
            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList1, slideIdList1, slideSize1, notesSize1, defaultTextStyle1);

            SlidePart       slidePart1;
            SlideLayoutPart slideLayoutPart1;
            SlideMasterPart slideMasterPart1;
            ThemePart       themePart1;

            slidePart1       = CreateSlidePart(presentationPart);
            slideLayoutPart1 = CreateSlideLayoutPart(slidePart1);
            slideMasterPart1 = CreateSlideMasterPart(slideLayoutPart1);
            themePart1       = CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            presentationPart.AddPart(slideMasterPart1, "rId1");
            presentationPart.AddPart(themePart1, "rId5");

            // Start set layout.

            /*
             * string layoutName = "Title and Content";
             *
             * // Get SlideMasterPart and SlideLayoutPart from the existing Presentation Part
             * SlideMasterPart slideMasterPart = presentationPart.SlideMasterParts.First();
             * SlideLayoutPart slideLayoutPart = slideMasterPart.SlideLayoutParts.SingleOrDefault
             *  (sl => sl.SlideLayout.CommonSlideData.Name.Value.Equals(layoutName, StringComparison.OrdinalIgnoreCase));
             * if (slideLayoutPart == null)
             * {
             *  throw new Exception("The slide layout " + layoutName + " is not found");
             * }
             *
             * slidePart1.AddPart<SlideLayoutPart>(slideLayoutPart);
             */
            // End set layout.
        }
Esempio n. 3
0
        private void insert(PresentationPart presentationPart, List <String> imgList)
        {
            int  idx        = 1;
            uint uid        = UInt32.MaxValue;
            var  slideParts = presentationPart.SlideParts;

            string            slideMasterRid    = "rId" + idx;
            SlideMasterIdList slideMasterIdList = new SlideMasterIdList(new SlideMasterId()
            {
                Id = uid, RelationshipId = slideMasterRid
            });
            SlideIdList slideIdList = new SlideIdList();
            SlideSize   slideSize   = new SlideSize()
            {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize = new NotesSize()
            {
                Cx = 6858000, Cy = 9144000
            };
            DefaultTextStyle defaultTextStyle = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList, slideIdList, slideSize, notesSize, defaultTextStyle);

            SlideLayoutPart layoutPart = null;
            SlideMasterPart masterPart = null;
            ThemePart       themePart  = null;

            foreach (string imgPath in imgList)
            {
                String imgIdx   = "rId" + (900 + idx);
                String slideIdx = "rId" + (idx + 1);
                String themeIdx = "rId" + (idx + 4);

                var slidePart = CreateSlidePart(presentationPart, slideIdx, uid = uid - 10);
                if (null == layoutPart)
                {
                    layoutPart = CreateSlideLayoutPart(slidePart, slideMasterRid, uid = uid - 10);
                    masterPart = CreateSlideMasterPart(layoutPart, slideMasterRid, uid = uid - 10);
                    themePart  = CreateTheme(masterPart, themeIdx);
                    masterPart.AddPart(layoutPart, slideMasterRid);
                    presentationPart.AddPart(masterPart, slideMasterRid);
                    presentationPart.AddPart(themePart, themeIdx);
                }

                //insert(slidePart, imgPath, imgIdx, uid = uid - 10);
                idx += 5;
            }
            presentationPart.Presentation.Save();
        }
Esempio n. 4
0
        public static void CreatePresentationPart(PresentationPart part, PPTXSetting FileSettings, PPTXSlideLayoutGroup SlideLayouts)
        {
            var partCreator = new DefaultPresentationPart();

            partCreator._CreatePresentationPart(part);

            SlidePart slidePart1 = DefaultSlidePart.CreateSlidePart(part, "rId2", FileSettings);

            // 1枚目のスライド追加
            var topLayoutPart = new SlideLayout_TitleSlide();

            topLayoutPart.Init(EPPTXSlideLayoutType.TitleSlide, SlideLayouts);
            SlideLayoutPart slideLayoutPart1 = topLayoutPart.CreateSlideLayoutPart(slidePart1);
            SlideMasterPart slideMasterPart1 = DefaultSlideMasterPart.CreateSlideMasterPart(slideLayoutPart1, "rId1");
            ThemePart       themePart1       = DefaultTheme.CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            part.AddPart(slideMasterPart1, "rId1");
            part.AddPart(themePart1, "rId5");

            // 残りのスライドレイアウトを追加
            foreach (EPPTXSlideLayoutType layoutType in Enum.GetValues(typeof(EPPTXSlideLayoutType)))
            {
                if (layoutType == EPPTXSlideLayoutType.TitleSlide)
                {
                    continue;
                }

                var otherLayoutPartType = Type.GetType($"MDToPPTX.PPTX.DefaultParts.SlideLayouts.SlideLayout_{layoutType.ToString()}");
                if (otherLayoutPartType == null)
                {
                    continue;
                }
                SlideLayoutPartBase otherLayoutPart = Activator.CreateInstance(otherLayoutPartType) as SlideLayoutPartBase;
                if (otherLayoutPart != null)
                {
                    otherLayoutPart.Init(layoutType, SlideLayouts);
                    SlideLayoutPart otherSlideLayoutPart = otherLayoutPart.CreateSlideLayoutPart(slideMasterPart1);

                    otherSlideLayoutPart.AddPart(slideMasterPart1, "rId1");
                }
            }
        }
Esempio n. 5
0
        internal static void AppendSlideMasterFromPart(PresentationPart presentationPart, PresentationPart sourcePresentationPart, SlideMasterPart themeSlideMasterPart)
        {
            SlideMasterPart slideMasterPart = presentationPart.AddPart(themeSlideMasterPart, presentationPart.GetNextRelationshipId());

            AddSlideMasterToSlideMasterIdList(presentationPart, slideMasterPart);

            /*IDictionary<OpenXmlPart, OpenXmlPart> mapping = new Dictionary<OpenXmlPart, OpenXmlPart>()
             * {
             *  { sourcePresentationPart, presentationPart }
             * };
             *
             * CopyPartRecursive(presentationPart, sourcePresentationPart.ThemePart, presentationPart.GetNextRelationshipId(), mapping);*/
        }
        private static void CreatePresentationTempalte(PresentationPart presentationPart)
        {
            // create template pptx
            SlideMasterIdList slideMasterIdList = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = slideMasterRId
            });
            SlideIdList slideIdList = new SlideIdList(new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = slidePartRId
            });
            SlideSize slideSize = new SlideSize()
            {
                Cx = slideCx, Cy = slideCy, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize = new NotesSize()
            {
                Cx = slideCy, Cy = slideCx
            };
            DefaultTextStyle defaultTextStyle = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList, slideIdList, slideSize, notesSize, defaultTextStyle);

            SlidePart       templateSlidePart;
            SlideLayoutPart slideLayoutPart;
            SlideMasterPart slideMasterPart;
            ThemePart       themePart;


            templateSlidePart = CreateSlidePart(presentationPart);
            slideLayoutPart   = CreateSlideLayoutPart(templateSlidePart);
            slideMasterPart   = CreateSlideMasterPart(slideLayoutPart);
            themePart         = CreateTheme(slideMasterPart);

            slideMasterPart.AddPart(slideLayoutPart, slideMasterRId);
            presentationPart.AddPart(slideMasterPart, slideMasterRId);
            presentationPart.AddPart(themePart, themPartRId);
        }
        private static void CreatePresentationParts(PresentationPart presentationPart)
        {
            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId1"
            });
            SlideIdList slideIdList1 = new SlideIdList(new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = "rId2"
            });
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cx = 6858000, Cy = 9144000
            };
            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList1, slideIdList1, slideSize1, notesSize1, defaultTextStyle1);

            SlidePart       slidePart1;
            SlideLayoutPart slideLayoutPart1;
            SlideMasterPart slideMasterPart1;
            ThemePart       themePart1;


            slidePart1       = CreateSlidePart(presentationPart);
            slideLayoutPart1 = CreateSlideLayoutPart(slidePart1);
            slideMasterPart1 = CreateSlideMasterPart(slideLayoutPart1);
            themePart1       = CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            presentationPart.AddPart(slideMasterPart1, "rId1");
            presentationPart.AddPart(themePart1, "rId5");
        }
Esempio n. 8
0
        private static void CreatePresentationParts(PresentationPart presentationPart)
        {
            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId1"
            });
            SlideIdList slideIdList1 = new SlideIdList(new SlideId()
            {
                Id = (DocumentFormat.OpenXml.UInt32Value) 256U, RelationshipId = "rId2"
            });
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 12192000, Cy = 6858000
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cy = 6858000, Cx = 12192000
            };
            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList1, slideIdList1, slideSize1, notesSize1, defaultTextStyle1);

            SlidePart       slidePart1;
            SlideLayoutPart slideLayoutPart1;
            SlideMasterPart slideMasterPart1;
            ThemePart       themePart1;


            slidePart1       = CreateAddSlidePart(presentationPart, "rId2");
            slideLayoutPart1 = CreateSlideLayoutPart(slidePart1);
            slideMasterPart1 = CreateSlideMasterPart(slideLayoutPart1);
            themePart1       = CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            presentationPart.AddPart(slideMasterPart1, "rId1");
            presentationPart.AddPart(themePart1, "rId5");
        }
        // Apply a new theme to the presentation.
        public static void ApplyThemeToPresentation(PresentationDocument presentationDocument, PresentationDocument themeDocument)
        {
            if (presentationDocument == null)
            {
                throw new ArgumentNullException("presentationDocument");
            }
            if (themeDocument == null)
            {
                throw new ArgumentNullException("themeDocument");
            }

            // Get the presentation part of the presentation document.
            PresentationPart presentationPart = presentationDocument.PresentationPart;

            // Get the existing slide master part.
            SlideMasterPart slideMasterPart = presentationPart.SlideMasterParts.ElementAt(0);
            string          relationshipId  = presentationPart.GetIdOfPart(slideMasterPart);

            // Get the new slide master part.
            SlideMasterPart newSlideMasterPart = themeDocument.PresentationPart.SlideMasterParts.ElementAt(0);

            // Remove the existing theme part.
            presentationPart.DeletePart(presentationPart.ThemePart);

            // Remove the old slide master part.
            presentationPart.DeletePart(slideMasterPart);

            // Import the new slide master part, and reuse the old relationship ID.
            newSlideMasterPart = presentationPart.AddPart(newSlideMasterPart, relationshipId);

            // Change to the new theme part.
            presentationPart.AddPart(newSlideMasterPart.ThemePart);

            Dictionary <string, SlideLayoutPart> newSlideLayouts = new Dictionary <string, SlideLayoutPart>();

            foreach (var slideLayoutPart in newSlideMasterPart.SlideLayoutParts)
            {
                newSlideLayouts.Add(GetSlideLayoutType(slideLayoutPart), slideLayoutPart);
            }

            string          layoutType    = null;
            SlideLayoutPart newLayoutPart = null;

            // Insert the code for the layout for this example.
            string defaultLayoutType = "Title and Content";

            // Remove the slide layout relationship on all slides.
            foreach (var slidePart in presentationPart.SlideParts)
            {
                layoutType = null;

                if (slidePart.SlideLayoutPart != null)
                {
                    // Determine the slide layout type for each slide.
                    layoutType = GetSlideLayoutType(slidePart.SlideLayoutPart);

                    // Delete the old layout part.
                    slidePart.DeletePart(slidePart.SlideLayoutPart);
                }

                if (layoutType != null && newSlideLayouts.TryGetValue(layoutType, out newLayoutPart))
                {
                    // Apply the new layout part.
                    slidePart.AddPart(newLayoutPart);
                }
                else
                {
                    newLayoutPart = newSlideLayouts[defaultLayoutType];

                    // Apply the new default layout part.
                    slidePart.AddPart(newLayoutPart);
                }
            }
        }
Esempio n. 10
0
        public void MergeSlides(string presentationFolder, string sourcePresentation, string destPresentation, int id, int Index)
        {
            int Idx = 0;

            // Open the destination presentation.
            using (PresentationDocument myDestDeck = PresentationDocument.Open(presentationFolder + destPresentation, true))
            {
                PresentationPart destPresPart = myDestDeck.PresentationPart;

                // If the merged presentation does not have a SlideIdList
                // element yet, add it.
                if (destPresPart.Presentation.SlideIdList == null)
                {
                    destPresPart.Presentation.SlideIdList = new SlideIdList();
                }

                // Open the source presentation. This will throw an exception if
                // the source presentation does not exist.
                using (PresentationDocument mySourceDeck = PresentationDocument.Open(presentationFolder + sourcePresentation, false))
                {
                    PresentationPart sourcePresPart = mySourceDeck.PresentationPart;

                    // Get unique ids for the slide master and slide lists for use later.
                    uniqueId = GetMaxSlideMasterId(destPresPart.Presentation.SlideMasterIdList);
                    uint maxSlideId = GetMaxSlideId(destPresPart.Presentation.SlideIdList);

                    // Copy each slide in the source presentation, in order, to the destination presentation.
                    foreach (SlideId slideId in sourcePresPart.Presentation.SlideIdList)
                    {
                        if (Idx++ == Index)
                        {
                            SlidePart       sp;
                            SlidePart       destSp;
                            SlideMasterPart destMasterPart;
                            string          relId;
                            SlideMasterId   newSlideMasterId;
                            SlideId         newSlideId;

                            // Create a unique relationship id.
                            id++;
                            sp    = (SlidePart)sourcePresPart.GetPartById(slideId.RelationshipId);
                            relId = sourcePresentation.Remove(sourcePresentation.IndexOf('.')) + id;

                            // Add the slide part to the destination presentation.
                            destSp = destPresPart.AddPart <SlidePart>(sp, relId);

                            // The slide master part was added. Make sure the
                            // relationship between the main presentation part and
                            // the slide master part is in place.
                            destMasterPart = destSp.SlideLayoutPart.SlideMasterPart;
                            destPresPart.AddPart(destMasterPart);

                            // Add the slide master id to the slide master id list.
                            uniqueId++;
                            newSlideMasterId = new SlideMasterId();
                            newSlideMasterId.RelationshipId = destPresPart.GetIdOfPart(destMasterPart);
                            newSlideMasterId.Id             = uniqueId;

                            destPresPart.Presentation.SlideMasterIdList.Append(newSlideMasterId);

                            // Add the slide id to the slide id list.
                            maxSlideId++;
                            newSlideId = new SlideId();
                            newSlideId.RelationshipId = relId;
                            newSlideId.Id             = maxSlideId;

                            destPresPart.Presentation.SlideIdList.Append(newSlideId);
                        }
                    }

                    // Make sure that all slide layout ids are unique.
                    FixSlideLayoutIds(destPresPart);
                }

                // Save the changes to the destination deck.
                destPresPart.Presentation.Save();
            }
        }
Esempio n. 11
0
        private void MergeSlides(PresentationInfo sourcePresentation, string destPresentation, ref Dictionary <int, int> reOrderPair, ref int val, out int reOrderConstantValue)
        {
            using (PresentationDocument destinationPresentationDoc = PresentationDocument.Open(destPresentation, true))
            {
                PresentationPart destPresPart = destinationPresentationDoc.PresentationPart;

                // If the merged presentation doesn't have a SlideIdList element yet then add it.
                if (destPresPart.Presentation.SlideIdList == null)
                {
                    destPresPart.Presentation.SlideIdList = new SlideIdList();
                }

                string sourceFileName = GetFileNameWithExtension(sourcePresentation.File);

                // Open the source presentation. This will throw an exception if the source presentation does not exist.
                using (PresentationDocument sourcePresentationDoc = PresentationDocument.Open(sourceFileName, false))
                {
                    PresentationPart sourcePresPart = sourcePresentationDoc.PresentationPart;

                    // Get unique ids for the slide master and slide lists for use later.
                    uniqueId = GetMaxSlideMasterId(destPresPart.Presentation.SlideMasterIdList);
                    uint maxSlideId = GetMaxSlideId(destPresPart.Presentation.SlideIdList);

                    reOrderConstantValue = sourcePresPart.Presentation.SlideIdList.Count();

                    // Copy each slide in the source presentation in order to the destination presentation.
                    foreach (SlideId slideId in sourcePresPart.Presentation.SlideIdList)
                    {
                        SlidePart       sp;
                        SlidePart       destSp;
                        SlideMasterPart destMasterPart;
                        string          relId;
                        SlideMasterId   newSlideMasterId;
                        SlideId         newSlideId;

                        //increase the slide count
                        mergedSideCount++;

                        if (sourcePresentation.InsertPosition != -1)
                        {
                            reOrderPair.Add(mergedSideCount - 1, val++);
                        }

                        // Create a unique relationship id.
                        id++;
                        sp    = (SlidePart)sourcePresPart.GetPartById(slideId.RelationshipId);
                        relId = "uniq" + id;

                        // Add the slide part to the destination presentation.
                        destSp = destPresPart.AddPart <SlidePart>(sp, relId);

                        // The master part was added. Make sure the relationship is in place.
                        destMasterPart = destSp.SlideLayoutPart.SlideMasterPart;
                        destPresPart.AddPart(destMasterPart);

                        // Add slide master to slide master list.
                        uniqueId++;
                        newSlideMasterId = new SlideMasterId();
                        newSlideMasterId.RelationshipId = destPresPart.GetIdOfPart(destMasterPart);
                        newSlideMasterId.Id             = uniqueId;

                        // Add slide to slide list.
                        maxSlideId++;
                        newSlideId = new SlideId();
                        newSlideId.RelationshipId = relId;
                        newSlideId.Id             = maxSlideId;

                        destPresPart.Presentation.SlideMasterIdList.Append(newSlideMasterId);
                        destPresPart.Presentation.SlideIdList.Append(newSlideId);
                    }

                    // Make sure all slide ids are unique.
                    ModifySlideLayoutIds(destPresPart);
                }

                // Save the changes to the destination presentation.
                destPresPart.Presentation.Save();
            }
        }
        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);
        }