diff --git a/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image.sln b/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image.sln new file mode 100644 index 0000000..f2b4e14 --- /dev/null +++ b/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35122.118 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDFPage-to-Image", "PDFPage-to-Image\PDFPage-to-Image.csproj", "{6016BC9A-43D0-4255-8302-84BC6EB16A29}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6016BC9A-43D0-4255-8302-84BC6EB16A29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6016BC9A-43D0-4255-8302-84BC6EB16A29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6016BC9A-43D0-4255-8302-84BC6EB16A29}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6016BC9A-43D0-4255-8302-84BC6EB16A29}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {67049C12-8F85-4D77-BA02-F802BA909F47} + EndGlobalSection +EndGlobal diff --git a/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Data/Input.pdf b/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Data/Input.pdf new file mode 100644 index 0000000..8773442 Binary files /dev/null and b/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Data/Input.pdf differ diff --git a/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Output/.gitkeep b/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Output/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/PDFPage-to-Image.csproj b/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/PDFPage-to-Image.csproj new file mode 100644 index 0000000..a9767fb --- /dev/null +++ b/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/PDFPage-to-Image.csproj @@ -0,0 +1,24 @@ + + + + Exe + net8.0 + PDFPage_to_Image + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Program.cs b/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Program.cs new file mode 100644 index 0000000..28813df --- /dev/null +++ b/PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Program.cs @@ -0,0 +1,29 @@ +using Syncfusion.PdfToImageConverter; +using System.IO; + + +namespace NET +{ + class Programe + { + public static void Main(string[] args) + { + //Initialize PDF to Image converter. + PdfToImageConverter imageConverter = new PdfToImageConverter(); + + //Load the PDF document as a stream + FileStream inputStream = new FileStream("../../../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)) + { + //Save the image to file stream. + inputStream.CopyTo(outputFileStream); + } + } + } +}