Skip to content

Commit 561dd88

Browse files
Feed back changes
1 parent dd6fc62 commit 561dd88

File tree

1 file changed

+5
-1
lines changed
  • PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image

1 file changed

+5
-1
lines changed

PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Program.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ public static void Main(string[] args)
1919
//Convert PDF to Image.
2020
Stream outputStream = imageConverter.Convert(0, false, false);
2121

22+
//Rewind the stream position to the beginning before copying.
23+
outputStream.Position = 0;
24+
2225
//Create file stream.
2326
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.jpeg"), FileMode.Create, FileAccess.ReadWrite))
2427
{
2528
//Save the image to file stream.
26-
inputStream.CopyTo(outputFileStream);
29+
outputStream.CopyTo(outputFileStream);
2730
}
31+
//Dispose the imageConverter
2832
imageConverter.Dispose();
2933
}
3034
}

0 commit comments

Comments
 (0)