@@ -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