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: Document-Processing/PDF/PDF-Library/NET/tabcontent-support/Create-PDF-document-in-Blazor-MaUI-VS-Code.md
+26-29Lines changed: 26 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,29 +1,26 @@
1
1
**Prerequisites**:
2
2
3
-
* Install .NET SDK: Ensure that you have the .NET SDK installed on your system. You can download it from the [.NET Downloads page](https://dotnet.microsoft.com/en-us/download).
4
-
* Install Visual Studio Code: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download).
5
-
* Install C# Extension for VS Code: Open Visual Studio Code, go to the Extensions view (Ctrl+Shift+X), and search for 'C#'. Install the official [C# extension provided by Microsoft](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp).
6
-
7
-
3
+
***.NET 8 SDK**: Ensure you have .NET 8 or newer installed from [.NET Downloads](https://dotnet.microsoft.com/en-us/download)
4
+
***Visual Studio Code**: Install from [official site](https://code.visualstudio.com/download)
5
+
***C# Extension**: Install the [C# extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) in VS Code
8
6
9
7
Step 1: Open the terminal (Ctrl+` ) and run the following command to create a new Blazor Server application
10
8
11
-
```
12
-
dotnet new maui-blazor -n CreatePdfBlazorMaUIApp
13
-
```
14
-
Step 2: Replace ****CreatePdfBlazorMaUIApp** with your desired project name.
9
+
```
10
+
dotnet new maui-blazor -n CreatePdfBlazorMaUIApp
11
+
```
15
12
16
-
Step 3: Navigate to the project directory using the following command
13
+
Step 2: Navigate to the project directory using the following command
17
14
18
-
```
19
-
cd CreatePdfBlazorMaUIApp
20
-
```
21
-
Step 4: Use the following command in the terminal to add the[Syncfusion.PDF.NET](https://www.nuget.org/packages/Syncfusion.pdf.Net) package to your project.
15
+
```
16
+
cd CreatePdfBlazorMaUIApp
17
+
```
18
+
Step 3: Use the following command in the terminal to add the [Syncfusion.PDF.NET](https://www.nuget.org/packages/Syncfusion.pdf.Net) package to your project.
22
19
23
-
```
24
-
dotnet add package Syncfusion.Pdf.Net
25
-
```
26
-
Step 5: Next, include the following namespaces in the ``_Imports.razor`` file.
20
+
```
21
+
dotnet add package Syncfusion.Pdf.Net
22
+
```
23
+
Step 4: Include necessary namespaces in `_Imports.razor` file.
27
24
28
25
{% tabs %}
29
26
{% highlight c# tabtitle="C#" %}
@@ -38,7 +35,7 @@ Step 5: Next, include the following namespaces in the ``_Imports.razor`` file.
38
35
39
36
{% endtabs %}
40
37
41
-
Step 6: Create a button in the``Weather.razor`` using the following code.
38
+
Step 5: Create a button in ``Weather.razor`` using the following code.
42
39
43
40
{% tabs %}
44
41
@@ -50,7 +47,7 @@ Step 6: Create a button in the ``Weather.razor`` using the following code.
50
47
51
48
{% endtabs %}
52
49
53
-
Step 7: Define the ``@ExportToPdf`` click function on ``Weather.razor`` file.
50
+
Step 6: Define the `@ExportToPdf` click function on `Weather.razor` file.
54
51
55
52
The [PdfDocument](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.PdfDocument.html) object represents an entire PDF document that is being created and add a [PdfPage](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.PdfPage.html) to it. The [PdfTextElement](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.Graphics.PdfTextElement.html) is used to add text in a PDF document and which provides the layout result of the added text by using the location of the next element that decides to prevent content overlapping. The [PdfGrid](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.Grid.PdfGrid.html) allows you to create table by entering data manually or from an external data source.
56
53
@@ -109,18 +106,18 @@ The [PdfDocument](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.Pdf
109
106
110
107
{% endtabs %}
111
108
112
-
Step 8: Build the project.
109
+
Step 7: Build the project.
113
110
114
111
Run the following command in terminal to build the project.
115
112
116
-
```
117
-
dotnet build
118
-
```
113
+
```
114
+
dotnet build
115
+
```
119
116
120
-
Step 9: Run the project.
117
+
Step 8: Run the project.
121
118
122
-
Run the following command in terminal to build the project.
119
+
Run the following command in terminal to run the application.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/NET/tabcontent-support/Create-PDF-document-in-Blazor-MaUI-Visual-studio.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
**Prerequisites**:
2
2
3
-
* Install .NET SDK: Ensure that you have the .NET SDK installed on your system. You can download it from the [.NET Downloads page](https://dotnet.microsoft.com/en-us/download).
4
-
* Install Visual Studio: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download).
3
+
***Install .NET SDK**: Ensure that you have the .NET SDK installed on your system. You can download it from the [.NET Downloads page](https://dotnet.microsoft.com/en-us/download).
4
+
***Install Visual Studio**: Download and install Visual Studio. For this example, we'll use Visual Studio 2022. You can download it from the [official Visual Studio website](https://visualstudio.microsoft.com/downloads/).
5
5
6
-
Step 1: Create a new project by choosing `.NET MAUI Blazor Hybrid and Web App` template in Visual Studio.
6
+
Step 1: Create a new .NET MAUI Blazor Hybrid project in Visual Studio
Step 2: Install the [Syncfusion.PDF.NET](https://www.nuget.org/packages/Syncfusion.pdf.Net) NuGet package as a reference to your Blazor application from [NuGet.org](https://www.nuget.org).
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/NET/tabcontent-support/Create-PDF-document-in-Blazor-WASM-JetBrains.md
+20-21Lines changed: 20 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,35 +3,34 @@
3
3
* JetBrains Rider.
4
4
* Install .NET 8 SDK or later.
5
5
6
-
Step 1. Open JetBrains Rider and create a new Blazor WASM app project.
7
-
* Launch JetBrains Rider.
8
-
* Click new solution on the welcome screen.
6
+
Step 1: Create a new Blazor WebAssembly App project in JetBrains Rider.
Step 2: Install the NuGet package from [NuGet.org](https://www.nuget.org/).
21
20
* Click the NuGet icon in the Rider toolbar and type [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core) in the search bar.
22
-
* Ensure that "nuget.org" is selected as the package source.
23
-
* Select the latest Syncfusion.Pdf.Net.Core NuGet package from the list.
24
-
* Click the + (Add) button to add the package.
21
+
* Ensure that `nuget.org` is selected as the package source.
22
+
* Select the latest `Syncfusion.Pdf.Net.Core` NuGet package from the list.
23
+
* Click the **Add** button (or the `+` icon) to add the package.
25
24
26
25

27
26
28
-
* Click the Install button to complete the installation.
27
+
* Click the **Install** button to complete the installation.
29
28
30
29

31
30
32
-
N> Starting with v16.2.0.x, if you reference Syncfusion<sup>®</sup> assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion<sup>®</sup> license key in your application to use our components.
31
+
N> Starting with v16.2.0.x, if referencing Syncfusion<sup>®</sup> assemblies from trial setup or from the NuGet feed, add "Syncfusion.Licensing" assembly reference and include a license key in projects. Refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to learn about registering Syncfusion<sup>®</sup> license key in applications to use the components.
33
32
34
-
Step 5: Next, include the following namespaces in that ``FetchData.razor`` file.
33
+
Step 3: Include necessary namespaces in `FetchData.razor` file.
35
34
36
35
{% tabs %}
37
36
{% highlight c# tabtitle="C#" %}
@@ -46,15 +45,15 @@ Step 5: Next, include the following namespaces in that ``FetchData.razor`` file
46
45
{% endhighlight %}
47
46
{% endtabs %}
48
47
49
-
Step 6: Create a button in the ``FetchData.razor`` using the following code.
48
+
Step 4: Create a button in `FetchData.razor` using the following code.
50
49
51
50
{% tabs %}
52
51
{% highlight CSHTML %}
53
52
<button class="btn btn-primary" @onclick="@ExportToPdf">Export to PDF</button>
54
53
{% endhighlight %}
55
54
{% endtabs %}
56
55
57
-
Step 7: Define the ``@ExportToPdf`` click function on ``FetchData.razor`` file.
56
+
Step 5: Define the `@ExportToPdf` click function on `FetchData.razor` file.
58
57
59
58
The [PdfDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.PdfDocument.html) object represents an entire PDF document that is being created and add a [PdfPage](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.PdfPage.html) to it. The [PdfTextElement](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Graphics.PdfTextElement.html) is used to add text in a PDF document and which provides the layout result of the added text by using the location of the next element that decides to prevent content overlapping. The [PdfGrid](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Grid.PdfGrid.html) allows you to create table by entering data manually or from an external data sources.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/NET/tabcontent-support/Create-PDF-document-in-Blazor-WASM-VS-Code.md
+24-29Lines changed: 24 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,29 +1,26 @@
1
1
**Prerequisites**:
2
2
3
-
*Install .NET SDK: Ensure that you have the .NET SDK installed on your system. You can download it from the [.NET Downloads page](https://dotnet.microsoft.com/en-us/download).
4
-
*Install Visual Studio Code: Download and install Visual Studio Code from the [official website](https://code.visualstudio.com/download).
5
-
*Install C# Extension for VS Code: Open Visual Studio Code, go to the Extensions view (Ctrl+Shift+X), and search for 'C#'. Install the official [C# extension provided by Microsoft](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp).
3
+
***.NET 8 SDK**: Ensure you have .NET 8 or newer installed from [.NET Downloads](https://dotnet.microsoft.com/en-us/download)
4
+
***Visual Studio Code**: Install from [official site](https://code.visualstudio.com/download)
5
+
***C# Extension**: Install the [C# extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) in VS Code
6
6
7
-
8
-
9
-
Step 1: Open the terminal (Ctrl+` ) and run the following command to create a new Blazor Server application
7
+
Step 1: Open the terminal (Ctrl+`) and run the following command to create a new Blazor Server application
10
8
11
9
```
12
10
dotnet new blazorwasm -o CreatePdfBlazorWASMApp
13
11
```
14
-
Step 2: Replace ****CreatePdfBlazorWASMApp** with your desired project name.
15
12
16
-
Step 3: Navigate to the project directory using the following command
13
+
Step 2: Navigate to the project directory using the following command
17
14
18
15
```
19
16
cd CreatePdfBlazorWASMApp
20
17
```
21
-
Step 4: Use the following command in the terminal to add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.pdf.Net.Core) package to your project.
18
+
Step 3: Use the following command in the terminal to add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.pdf.Net.Core) package to your project.
22
19
23
20
```
24
21
dotnet add package Syncfusion.Pdf.Net.Core
25
22
```
26
-
Step 5: Create a new cs file named **ExportService.cs** under **Data** folder and include the following namespaces in the file.
23
+
Step 4: Create a new cs file named **ExportService.cs** under **Data** folder and include the following namespaces in the file.
27
24
28
25
{% tabs %}
29
26
{% highlight c# tabtitle="C#" %}
@@ -36,9 +33,9 @@ using Syncfusion.Drawing;
36
33
{% endhighlight %}
37
34
{% endtabs %}
38
35
39
-
Step 6: The [PdfDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.PdfDocument.html) object represents an entire PDF document that is being created. The [PdfTextElement](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Graphics.PdfTextElement.html) is used to add text in a PDF document and which provides the layout result of the added text by using the location of the next element that decides to prevent content overlapping. The [PdfGrid](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Grid.PdfGrid.html) allows you to create table by entering data manually or from an external data sources.
36
+
Step 5: The [PdfDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.PdfDocument.html) object represents an entire PDF document that is being created. The [PdfTextElement](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Graphics.PdfTextElement.html) is used to add text in a PDF document and which provides the layout result of the added text by using the location of the next element that decides to prevent content overlapping. The [PdfGrid](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Grid.PdfGrid.html) allows you to create table by entering data manually or from an external data sources.
40
37
41
-
Add the following code sample in ``ExportService`` class which illustrates how to create a simple PDF document using ``PdfTextElement`` and ``PdfGrid``.
38
+
Add the following code sample in `ExportService` class which illustrates how to create a simple PDF document using `PdfTextElement` and `PdfGrid`.
42
39
43
40
{% tabs %}
44
41
{% highlight c# tabtitle="C#" %}
@@ -97,7 +94,7 @@ public static MemoryStream CreatePdf(WeatherForecast[] forecasts)
97
94
{% endhighlight %}
98
95
{% endtabs %}
99
96
100
-
Register your service in the ``ConfigureServices`` method available in the ``Startup.cs`` class as follows.
97
+
Register service in the `ConfigureServices` method available in the `Startup.cs` class as follows.
101
98
102
99
{% tabs %}
103
100
{% highlight c# tabtitle="C#" %}
@@ -111,7 +108,7 @@ public void ConfigureServices(IServiceCollection services)
111
108
{% endhighlight %}
112
109
{% endtabs %}
113
110
114
-
Step 7: Inject ``ExportService`` in-to ``FetchData.razor`` using the following code.
111
+
Step 6: Inject `ExportService` into `FetchData.razor` using the following code.
115
112
116
113
{% tabs %}
117
114
{% highlight CSHTML %}
@@ -123,15 +120,15 @@ Step 7: Inject ``ExportService`` in-to ``FetchData.razor`` using the following c
123
120
{% endhighlight %}
124
121
{% endtabs %}
125
122
126
-
Create a button in the ``FetchData.razor`` using the following code.
123
+
Create a button in the `FetchData.razor` using the following code.
127
124
128
125
{% tabs %}
129
126
{% highlight CSHTML %}
130
127
<button class="btn btn-primary" @onclick="@ExportToPdf">Export to PDF</button>
131
128
{% endhighlight %}
132
129
{% endtabs %}
133
130
134
-
Add the ``ExportToPdf`` method in ``FetchData.razor`` page to call the export service.
131
+
Add the `ExportToPdf` method in `FetchData.razor` page to call the export service.
135
132
136
133
{% tabs %}
137
134
{% highlight c# tabtitle="C#" %}
@@ -148,7 +145,7 @@ Add the ``ExportToPdf`` method in ``FetchData.razor`` page to call the export se
148
145
{% endhighlight %}
149
146
{% endtabs %}
150
147
151
-
Step 8: Create a class file with ``FileUtil`` name and add the following code to invoke the JavaScript action to download the file in the browser.
148
+
Step 7: Create a class file with `FileUtil` name and add the following code to invoke the JavaScript action to download the file in the browser.
152
149
153
150
{% tabs %}
154
151
@@ -167,7 +164,7 @@ public static class FileUtil
167
164
168
165
{% endtabs %}
169
166
170
-
Step 9: Add the following JavaScript function in the ``_Host.cshtml`` available under the ``Pages`` folder.
167
+
Step 8: Add the following JavaScript function in the `_Host.cshtml` available under the `Pages` folder.
171
168
172
169
{% tabs %}
173
170
@@ -200,18 +197,16 @@ Step 9: Add the following JavaScript function in the ``_Host.cshtml`` available
200
197
201
198
{% endtabs %}
202
199
203
-
Step 10: Build the project.
204
-
205
-
Run the following command in terminal to build the project.
206
-
207
-
```
208
-
dotnet build
209
-
```
200
+
Step 9: Build the project.
201
+
Run the following command in terminal to build the project.
210
202
211
-
12. Run the project:
203
+
```
204
+
dotnet build
205
+
```
212
206
213
-
Run the following command in terminal to run the project.
207
+
Step 10: Run the project.
208
+
Run the following command in terminal to run the application.
0 commit comments