You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Readme.md
+6-22Lines changed: 6 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -2,35 +2,18 @@
2
2
3
3
## Steps to create images from PDF in ASP.NET Core
4
4
5
-
Step 1: Create a new C# ASP.NET Core Web Application project.
5
+
Step 1: Create a new .NET Console application.
6
6
7
-
Step 2: Select Web Application pattern (Model-View-Controller) for the project.
7
+
Step 2: Install the [Syncfusion.PdfToImageConverter.Net](https://www.nuget.org/packages/Syncfusion.PdfToImageConverter.Net/)[NuGet package]
8
8
9
-
Step 3: Install the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.PdfToImageConverter.Net/)[NuGet package](https://help.syncfusion.com/document-processing/nuget-packages) as reference to your ASP.NET Core applications from [NuGet.org](https://www.nuget.org/).
10
-
11
-
Step 4: A default controller with name HomeController.cs gets added on creation of ASP.NET Core project. Include the following namespaces in that HomeController.cs file.
9
+
Step 3: Add the Data folder and Output folder parallel to the Program.cs file.Data folder will hold the PDF files that you want to convert.Output Folder will store the resulting image files after conversion.
12
10
11
+
Step 4: Add the following namespaces and code in application Programe.cs file.
13
12
14
13
```
15
14
using Syncfusion.PdfToImageConverter;
16
15
using System.IO;
17
-
```
18
-
19
-
Step 5: A default action method named Index will be present in HomeController.cs. Right click on Index method and select Go To View where you will be directed to its associated view page Index.cshtml. Add a new button in the Index.cshtml as shown below.
<input type="submit" value="Create PDF to Image" style="width:200px;height:27px" />
26
-
</div>
27
-
}
28
-
Html.EndForm();
29
-
}
30
-
```
31
-
32
-
Step 6: Add a new action method named ``CreateImage`` in HomeController.cs file and include the below code example to generate a image from PDF document using the PdfToImageConverter.
33
-
```
34
17
//Initialize PDF to Image converter.
35
18
PdfToImageConverter imageConverter = new PdfToImageConverter();
36
19
@@ -53,4 +36,5 @@ using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Ou
53
36
}
54
37
//Dispose the imageConverter
55
38
imageConverter.Dispose();
56
-
```
39
+
```
40
+
Step 5 : Run the application, and the images will be saved in the Output folder.
0 commit comments