Skip to content

Commit

Permalink
Merge pull request #40 from SyncfusionExamples/PdfToImageSample
Browse files Browse the repository at this point in the history
Pdf to image sample
  • Loading branch information
Vikassekar authored Aug 21, 2024
2 parents 2dc114a + ca867d2 commit 4da81df
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ public static void Main(string[] args)
PdfToImageConverter imageConverter = new PdfToImageConverter();

//Load the PDF document as a stream
FileStream inputStream = new FileStream("../../../Data/Input.pdf", FileMode.Open, FileAccess.ReadWrite);
FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.ReadWrite);

imageConverter.Load(inputStream);

//Convert PDF to Image.
Stream outputStream = imageConverter.Convert(0, false, false);

//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output/Output.jpeg"), FileMode.Create, FileAccess.ReadWrite))
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.jpeg"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the image to file stream.
inputStream.CopyTo(outputFileStream);
Expand Down

0 comments on commit 4da81df

Please sign in to comment.