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.
1 parent dd6fc62 commit 561dd88Copy full SHA for 561dd88
PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Program.cs
@@ -19,12 +19,16 @@ 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
0 commit comments