Exemple #1
0
        public void GenerateWordDocument(string docName, SessionData sessionObjects, AdditionalData additionalObjects)
        {
            _sessionObjects = sessionObjects;
            _additionalObjects = additionalObjects;
            //var openS = new OpenSettings();
            //openS.MarkupCompatibilityProcessSettings = new MarkupCompatibilityProcessSettings(
            //    MarkupCompatibilityProcessMode.ProcessAllParts, FileFormatVersions.Office2007);
            //using (_wordDocument = WordprocessingDocument.Open(docName, true, openS))
            using (_wordDocument = WordprocessingDocument.Create(docName, WordprocessingDocumentType.Document))
            {
                InitilizeDocument();

                GenerateTitlePage();
                GeneratePageTwo();
                GenerateChapterOne();
                GenerateChapterTwo();
                GenerateChapterThree();
                GenerateChapterFour();
                GenerateChapterFive();
                GenerateChapterSix();
                GenerateChapterSeven();
                GenerateChapterEight();
                GenerateChapterNine();
                GenerateChapterTen();
                var numberingDefinitionsPart = _mainPart.AddNewPart<NumberingDefinitionsPart>();
                numberingDefinitionsPart.Numbering = _numbering;
            }
        }
Exemple #2
0
 public Manager()
 {
     _startDir = Directory.GetCurrentDirectory() + @"\Sessions\Start";
     _completeDir = Directory.GetCurrentDirectory() + @"\Sessions\Complete";
     if (!Directory.Exists("Sessions"))
     {
         Directory.CreateDirectory("Sessions");
     }
     if (!Directory.Exists(_startDir))
     {
         Directory.CreateDirectory(_startDir);
     }
     if (!Directory.Exists(_completeDir))
     {
         Directory.CreateDirectory(_completeDir);
     }
     SessionObjects = new SessionData();
     AdditionalObjects = new AdditionalData();
     ClearSession();
 }