Skip to content

Commit 837ad67

Browse files
committed
Removed unnecessary spaces
1 parent 296b61f commit 837ad67

File tree

1 file changed

+2
-9
lines changed
  • Word-to-PPTX-Conversion/Convert-Word-document-to-PPTX/.NET/Convert-Word-document-to-PPTX

1 file changed

+2
-9
lines changed

Word-to-PPTX-Conversion/Convert-Word-document-to-PPTX/.NET/Convert-Word-document-to-PPTX/Program.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,19 @@ class Program
99
private static IPresentation pptxDoc;
1010
static void Main(string[] args)
1111
{
12-
FileStream fileStreamPath = new FileStream("../../../Data/Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
1312
//Opens an existing document from file system through constructor of WordDocument class
14-
using (WordDocument document = new WordDocument(fileStreamPath, Syncfusion.DocIO.FormatType.Automatic))
13+
using (WordDocument document = new WordDocument(Path.GetFullPath("../../../Data/Adventure.docx"), Syncfusion.DocIO.FormatType.Automatic))
1514
{
1615
pptxDoc = Presentation.Create();
17-
1816
foreach (WSection section in document.Sections)
1917
{
2018
//Accesses the Body of section where all the contents in document are apart
2119
WTextBody sectionBody = section.Body;
2220
AddTextBodyItems(sectionBody);
2321
}
24-
FileStream outputStream = new FileStream("../../../Output/DocxToPptx.pptx", FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
22+
FileStream outputStream = new FileStream(Path.GetFullPath("../../../Output/DocxToPptx.pptx"), FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
2523
pptxDoc.Save(outputStream);
2624
outputStream.Close();
27-
2825
}
2926
}
3027

@@ -54,7 +51,6 @@ private static void AddTextBodyItems(WTextBody docTextBody, ICell powerPointTabl
5451
//IEntity is the basic unit in DocIO DOM.
5552
//Accesses the body items (should be either paragraph, table or block content control) as IEntity
5653
IEntity bodyItemEntity = docTextBody.ChildEntities[i];
57-
5854
//A Text body has 3 types of elements - Paragraph, Table and Block Content Control
5955
//Decides the element type by using EntityType
6056
switch (bodyItemEntity.EntityType)
@@ -103,7 +99,6 @@ private static void AddTextBodyItems(WTextBody docTextBody, ICell powerPointTabl
10399
AddParagraphItems(docParagraph, powerPointParagraph);
104100
}
105101
break;
106-
107102
case EntityType.Table:
108103
//Table is a collection of rows and cells
109104
//Iterates through table's DOM
@@ -124,7 +119,6 @@ private static void AddTextBodyItems(WTextBody docTextBody, ICell powerPointTabl
124119
}
125120
}
126121
break;
127-
128122
case EntityType.BlockContentControl:
129123
BlockContentControl blockContentControl = bodyItemEntity as BlockContentControl;
130124
//Iterates to the body items of Block Content Control.
@@ -191,7 +185,6 @@ private static void AddParagraphItems(WParagraph docParagraph, IParagraph powerP
191185
}
192186
}
193187
break;
194-
195188
case EntityType.Picture:
196189
//Checks whether the image is inside a cell
197190
if (docParagraph.IsInCell && powerPointTableCell != null)

0 commit comments

Comments
 (0)