We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4da81df + 561dd88 commit 5671983Copy full SHA for 5671983
PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Program.cs
@@ -19,12 +19,17 @@ public static void Main(string[] args)
19
//Convert PDF to Image.
20
Stream outputStream = imageConverter.Convert(0, false, false);
21
22
+ //Rewind the stream position to the beginning before copying.
23
+ outputStream.Position = 0;
24
+
25
//Create file stream.
26
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.jpeg"), FileMode.Create, FileAccess.ReadWrite))
27
{
28
//Save the image to file stream.
- inputStream.CopyTo(outputFileStream);
29
+ outputStream.CopyTo(outputFileStream);
30
}
31
+ //Dispose the imageConverter
32
+ imageConverter.Dispose();
33
34
35
0 commit comments