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-Viewer/asp-net-core/save-pdf-file/to-amazon-s3.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,30 @@
1
1
---
2
2
layout: post
3
-
title: AWS S3 in ASP.NET Core Syncfusion PDF Viewer Component
4
-
description: Save PDF files to AWS S3 in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more.
3
+
title: Save PDF files to AWS S3 in ASP.NET Core PDF Viewer | Syncfusion
4
+
description: Learn how to save PDF files to AWS S3 using the Syncfusion ASP.NET Core PDF Viewer component in standalone and server-backed configurations.
5
5
platform: document-processing
6
6
control: PDF Viewer
7
7
publishingplatform: ASP.NET Core
8
8
documentation: ug
9
9
---
10
10
11
-
# Save PDF file to AWS S3
11
+
# Save PDF files to AWS S3
12
12
13
-
PDF Viewer allows to save PDF file to AWS S3 using either the Standalone or Server-backed PDF Viewer. Below are the steps and a sample to demonstrate how to save PDF to AWS S3.
13
+
The ASP.NET Core PDF Viewer component supports saving PDF files to AWS S3 using either the standalone or server-backed configuration. The following steps demonstrate both approaches.
14
14
15
-
## Using Standalone PDF Viewer
15
+
## Using the standalone PDF Viewer
16
16
17
-
To save a PDF file to AWS S3, you can follow the steps below
17
+
To save a PDF file to AWS S3, follow these steps:
18
18
19
-
**Step 1:** Create AWS S3 account
19
+
**Step 1:** Create an AWS S3 account
20
20
21
21
Set up an AWS S3 account by following the instructions on the official AWS site: [AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). Create an S3 bucket and generate access keys while ensuring secure storage of credentials.
22
22
23
-
**Step 2:** Create PDF Viewer Sample in ASP.NET Core
23
+
**Step 2:** Create a PDF Viewer sample in ASP.NET Core
24
24
25
25
Follow instructions provided in the Syncfusion<supstyle="font-size:70%">®</sup> PDF Viewer Getting Started [Guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-core/getting-started) to create a simple PDF Viewer sample in ASP.NET Core.
26
26
27
-
**Step 3:** Modify the `~/Pages/Shared/_Layout.cshtml`File in the Project
27
+
**Step 3:** Modify the `~/Pages/Shared/_Layout.cshtml`file in the project
28
28
29
29
1. Add the required scripts using CDN inside the `<head>` of `~/Pages/Shared/_Layout.cshtml` file as follows,
30
30
@@ -39,7 +39,7 @@ Follow instructions provided in the Syncfusion<sup style="font-size:70%">®</
39
39
{% endhighlight %}
40
40
{% endtabs %}
41
41
42
-
**Step 4:** Modify the `~/Pages/Index.cshtml`File in the Project
42
+
**Step 4:** Modify the `~/Pages/Index.cshtml`file in the project
43
43
44
44
1. Configures AWS SDK with the region, access key, and secret access key. This configuration allows the application to interact with AWS services like S3.
45
45
@@ -53,7 +53,7 @@ AWS.config.update({
53
53
});
54
54
```
55
55
56
-
2. Configure a custom toolbar item for the download function to save a PDF file in Azure Blob Storage.
56
+
2. Configure a custom toolbar item for the download function to save a PDF file to AWS S3.
57
57
58
58
```csharp
59
59
<div class="text-center">
@@ -119,19 +119,19 @@ N> The **AWSSDK.S3** NuGet package must be installed in your application to use
119
119
120
120
[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone).
121
121
122
-
## Using Server-Backed PDF Viewer
122
+
## Using the server-backed PDF Viewer
123
123
124
-
To save a PDF file to AWS S3, you can follow the steps below
124
+
To save a PDF file to AWS S3, follow these steps:
125
125
126
-
**Step 1:** Create AWS S3 account
126
+
**Step 1:** Create an AWS S3 account
127
127
128
128
Set up an AWS S3 account by following the instructions on the official AWS site: [AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). Create an S3 bucket and generate access keys while ensuring secure storage of credentials.
129
129
130
-
**Step 2:** Create PDF Viewer Sample in ASP.NET Core
130
+
**Step 2:** Create a PDF Viewer sample in ASP.NET Core
131
131
132
132
Follow instructions provided in the Syncfusion<supstyle="font-size:70%">®</sup> PDF Viewer Getting Started [Guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-core/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core.
133
133
134
-
**Step 3:** Modify the `Index.cshtml.cs`File in the Project
134
+
**Step 3:** Modify the `Index.cshtml.cs`file in the project
135
135
136
136
1. Import the required namespaces at the top of the file.
137
137
@@ -214,9 +214,9 @@ public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnviro
214
214
215
215
N> Replace **Your Access Key from AWS S3**, **Your Secret Key from AWS S3**, and **Your Bucket name from AWS S3** with your actual AWS access key, secret key and bucket name
216
216
217
-
**Step 4:**Set the PDF Viewer Properties in ASP.NET Core PDF viewer component
217
+
**Step 4:**Configure the PDF Viewer component
218
218
219
-
Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from AWS S3. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property.
219
+
Set the [serviceUrl](https://ej2.syncfusion.com/documentation/api/pdfviewer/#serviceurl) property of the PDF Viewer component with the actual server URL. Set the `documentPath` property to the desired PDF file name to load from AWS S3, and ensure that the document exists in the target bucket.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/asp-net-core/save-pdf-file/to-azure-active-directory.md
+49-52Lines changed: 49 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,35 +1,31 @@
1
1
---
2
2
layout: post
3
-
title: Save PDF To AAD in EJ2 ASP.NET Core PDF Viewer | Syncfusion
4
-
description: Learn here all about How to Save Pdf To AAD in ASP.NET Core Pdfviewer component of Syncfusion Essential JS 2 and more.
3
+
title: Save PDF files to Azure Active Directory (AAD) in ASP.NET Core PDF Viewer | Syncfusion
4
+
description: Learn how to load and save PDF files with Azure Active Directory (AAD) using the Syncfusion ASP.NET Core PDF Viewer component and a server-backed web service.
5
5
platform: document-processing
6
6
control: PDF Viewer
7
7
publishingplatform: ASP.NET Core
8
8
documentation: ug
9
9
---
10
10
11
-
# Save PDF To Azure Active Directory in Viewer
11
+
# Save PDF files to Azure Active Directory (AAD)
12
12
13
13
### **Overview**
14
14
15
-
The Syncfusion PDF Viewer allows you to load and save PDF files directly from Azure Active Directory (AAD). Below are the steps to securely load and store PDF documents from and to AAD using the PDF Viewer.
15
+
The ASP.NET Core PDF Viewer component supports loading and saving PDF files with Azure Active Directory (AAD). The following steps describe how to securely load and store PDF documents using a server-backed web service.
16
16
17
-
### **Steps to Open the PDF File from Azure Active Directory**
17
+
### **Step 1: Register an application in Azure Active Directory (AAD)**
18
18
19
-
---
20
-
21
-
### **Step 1: Register an Application in Azure Active Directory (AAD)**
22
-
23
-
1.**Go to the Azure Portal**:
19
+
1.**Go to the Azure portal**:
24
20
- Navigate to [Azure Portal](https://portal.azure.com).
25
21
26
-
2.**Register your Application**:
22
+
2.**Register the application**:
27
23
- In the Azure portal, go to **Azure Active Directory** > **App registrations** > **New registration**.
28
24
- Register your application and note down the **Application (client) ID** and **Directory (tenant) ID**.
- In the registered application, go to **Certificates & secrets**.
34
30
- Click **New client secret**.
35
31
- Provide a description and set an expiration period.
@@ -38,48 +34,70 @@ The Syncfusion PDF Viewer allows you to load and save PDF files directly from Az
38
34
39
35

40
36
41
-
---
42
-
43
-
### **Step 2: Create the Azure Storage Account**
37
+
### **Step 2: Create the Azure Storage account**
44
38
45
-
1.**Create a Storage Account**:
39
+
1.**Create a storage account**:
46
40
- In the Azure portal, use the search bar to search for **Storage accounts**.
47
41
- Create a new storage account by filling in the required details (e.g., name, location, resource group, etc.).
48
42
49
43

50
44
51
-
---
52
-
53
-
### **Step 3: Assign Role to the Application**
45
+
### **Step 3: Assign a role to the application**
54
46
55
-
1.**Go to your Storage Account**:
47
+
1.**Go to the storage account**:
56
48
- Navigate to **Access control (IAM)** > **Add role assignment** in your Azure Storage Account.
57
49
58
-
2.**Assign Role**:
50
+
2.**Assign a role**:
59
51
- Assign the **Storage Blob Data Contributor** role to your registered application.
60
52
- In the **Assign access to** dropdown, select **User, group, or service principal**.
61
53
- Click on **Select members** and search for your registered application by name or client ID.
62
54
- Select your application and click **Select**.
63
55
- Click **Review + assign** to finalize the role assignment.
64
56
65
57

66
-
---
67
58
68
-
### **Step 4: Upload the PDF Document to the Azure Storage Account**
59
+
### **Step 4: Upload the PDF document to Azure Storage**
69
60
70
-
1.**Navigate to Data Storage**:
61
+
1.**Navigate to Data storage**:
71
62
- In the Azure portal, go to **Data storage** > **Containers**.
72
63
73
-
2.**Upload the PDF File**:
64
+
2.**Upload the PDF file**:
74
65
- Create a new container and upload the PDF document you want to access in the PDF Viewer.
75
66
76
67

77
-
---
78
68
79
-
### **Step 5: ASP.NET Core PDF Viewer Control Configuration**
80
-
1. Follow the steps provided in the [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-core/getting-started-with-server-backed) to create a simple PDF Viewer sample.
69
+
### **Step 5: Server-side configuration**
70
+
71
+
1.**Configure server-side code**:
72
+
- Open the server-side application (e.g., ASP.NET Core) and configure the following details in the `PdfViewerController` file:
-`blobServiceEndpoint` (your storage account blob service URL),
77
+
-`containerName` (your container name in Azure Blob Storage).
78
+
79
+
2.**Run the web service**:
80
+
- After configuring the necessary details, run the web service to make it accessible.
81
81
82
-
2. Add the following code snippet in `Index.cshtml.cs`.
82
+
### **Client-side configuration**
83
+
84
+
1.**Run the ASP.NET Core sample**:
85
+
- Start the ASP.NET Core (Razor) sample that includes the Syncfusion PDF Viewer.
86
+
87
+
2.**Load a PDF from AAD**:
88
+
- When the user clicks the **Load from AAD** button, the client-side JavaScript will make an HTTP request to the server-side API to fetch the PDF from Azure Blob Storage.
89
+
- The server will retrieve the PDF from Azure, convert it to a Base64 string, and return it to the client.
90
+
91
+
3.**Display the PDF in the PDF Viewer**:
92
+
- Once the Base64 string is received, the PDF Viewer will load the PDF using the `viewer.load()` method.
93
+
94
+
### **Save the PDF document to Azure**
95
+
96
+
1. Save PDF to AAD:
97
+
- The user can click the **Save to AAD** button to upload any modifications to the PDF back to Azure Blob Storage.
98
+
- This action sends the modified PDF to the server, where it is converted into a byte array and saved to the specified Azure Blob container.
0 commit comments