File tree 1 file changed +3
-3
lines changed
Word-to-Image-conversion/Convert-Word-to-image/.NET/Convert-Word-to-image
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ class Program
9
9
{
10
10
static void Main ( string [ ] args )
11
11
{
12
+ // Open the Word document file stream
12
13
using ( FileStream fileStream = new FileStream ( Path . GetFullPath ( @"Data/Template.docx" ) , FileMode . Open ) )
13
14
{
14
15
//Loads an existing Word document.
@@ -17,14 +18,13 @@ static void Main(string[] args)
17
18
//Creates an instance of DocIORenderer.
18
19
using ( DocIORenderer renderer = new DocIORenderer ( ) )
19
20
{
20
- //Converts Word document to images.
21
+ //Convert the entire Word document to images.
21
22
Stream [ ] imageStreams = wordDocument . RenderAsImages ( ) ;
22
23
for ( int i = 0 ; i < imageStreams . Length ; i ++ )
23
24
{
24
- //Creates the output image file stream.
25
+ //Save the image stream as file .
25
26
using ( FileStream fileStreamOutput = File . Create ( Path . GetFullPath ( @"Output/Output_" + i + ".jpeg" ) ) )
26
27
{
27
- //Copies the converted image stream into created output stream.
28
28
imageStreams [ i ] . CopyTo ( fileStreamOutput ) ;
29
29
}
30
30
}
You can’t perform that action at this time.
0 commit comments