Skip to content

Commit 6cdee97

Browse files
Feed back changes
1 parent 1309347 commit 6cdee97

File tree

1 file changed

+6
-22
lines changed
  • PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image

1 file changed

+6
-22
lines changed

PDF-to-image/.NET/PDFPage-to-Image/PDFPage-to-Image/Readme.md

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,18 @@
22

33
## Steps to create images from PDF in ASP.NET Core
44

5-
Step 1: Create a new C# ASP.NET Core Web Application project.
5+
Step 1: Create a new .NET Console application.
66

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]
88

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.
1210

11+
Step 4: Add the following namespaces and code in application Programe.cs file.
1312

1413
```
1514
using Syncfusion.PdfToImageConverter;
1615
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.
2016
21-
```
22-
@{Html.BeginForm("CreateImage", "Home", FormMethod.Get);
23-
{
24-
<div>
25-
<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-
```
3417
//Initialize PDF to Image converter.
3518
PdfToImageConverter imageConverter = new PdfToImageConverter();
3619
@@ -53,4 +36,5 @@ using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Ou
5336
}
5437
//Dispose the imageConverter
5538
imageConverter.Dispose();
56-
```
39+
```
40+
Step 5 : Run the application, and the images will be saved in the Output folder.

0 commit comments

Comments
 (0)