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: ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-amazon-s3.md
+81-1Lines changed: 81 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,86 @@ documentation: ug
10
10
11
11
# Open PDF file from AWS S3
12
12
13
+
PDF Viewer allows to load PDF file from AWS S3 using either the Standalone or Server-backed PDF Viewer. Below are the steps and a sample to demonstrate how to open a PDF from AWS S3.
14
+
15
+
## Using Standalone PDF Viewer
16
+
17
+
To load a PDF file from AWS S3 in a PDF Viewer, you can follow the steps below
18
+
19
+
**Step 1:** Create AWS S3 account
20
+
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
+
23
+
**Step 2:** Create PDF Viewer Sample in ASP.NET MVC
24
+
25
+
Follow instructions provided in the Syncfusion PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample in ASP.NET MVC.
26
+
27
+
**Step 3:** Modify the `~/Views/Shared/_Layout.cshtml` File in the Project
28
+
29
+
1. Add the required scripts using CDN inside the `<head>` of `~/Views/Shared/_Layout.cshtml` file as follows,
**Step 4:** Modify the `~/Views/Home/Index.cshtml` File in the Project
43
+
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
+
46
+
N> Replace **Your Region** with the actual Region of your AWS S3 account and **Your Access Key** with the actual Access Key of your AWS S3 account and **Your Security Access Key** with the actual Security Access Key of your AWS S3 account.
47
+
48
+
```csharp
49
+
AWS.config.update({
50
+
region:'**Your Region**', // Update this your region
51
+
accessKeyId:'*Your Access Key*', // Update this with your access key id
52
+
secretAccessKey:'*Your Security Access Key*', // Update this with your secret access key
53
+
});
54
+
```
55
+
56
+
2. Sets the parameters for fetching the PDF document from S3, including the bucket name and file key. Then Uses the getObject method of the S3 instance to retrieve the document. Converts the document data to a Base64 string and loads it into the Syncfusion PDF Viewer then load Base64 string generated into the viewer.load method.
57
+
58
+
N> Replace **Your Bucket Name** with the actual Bucket name of your AWS S3 account and **Your Key** with the actual File Key of your AWS S3 account.
N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example.
88
+
89
+
[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).
90
+
91
+
## Using Server-Backed PDF Viewer
92
+
13
93
To load a PDF file from AWS S3 in a PDF Viewer, you can follow the steps below
14
94
15
95
**Step 1:** Create AWS S3 account
@@ -98,4 +178,4 @@ Set the `documentPath` property of the PDF viewer component to the desired name
Copy file name to clipboardExpand all lines: ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-amazon-s3.md
+116-1Lines changed: 116 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,121 @@ documentation: ug
10
10
11
11
# Save PDF file 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.
14
+
15
+
## Using Standalone PDF Viewer
16
+
17
+
To save a PDF file to AWS S3 bucket, you can follow the steps below
18
+
19
+
**Step 1:** Create AWS S3 account
20
+
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
+
23
+
**Step 2:** Create PDF Viewer Sample in ASP.NET MVC
24
+
25
+
Follow instructions provided in the Syncfusion PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample in ASP.NET MVC.
26
+
27
+
**Step 3:** Modify the `~/Views/Shared/_Layout.cshtml` File in the Project
28
+
29
+
1. Add the required scripts using CDN inside the `<head>` of `~/Views/Shared/_Layout.cshtml` file as follows,
**Step 4:** Modify the `~/Views/Home/Index.cshtml` File in the Project
43
+
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
+
46
+
N> Replace **Your Region** with the actual Region of your AWS S3 account and **Your Access Key** with the actual Access Key of your AWS S3 account and **Your Security Access Key** with the actual Security Access Key of your AWS S3 account.
47
+
48
+
```csharp
49
+
AWS.config.update({
50
+
region:'**Your Region**', // Update this your region
51
+
accessKeyId:'*Your Access Key*', // Update this with your access key id
52
+
secretAccessKey:'*Your Security Access Key*', // Update this with your secret access key
53
+
});
54
+
```
55
+
56
+
2. Configure a custom toolbar item for the download function to save a PDF file in Azure Blob Storage.
3. Retrieve the PDF viewer instance and save the current PDF as a Blob. Then, read the Blob using a FileReader to convert it into an ArrayBuffer, and upload the ArrayBuffer to AWS S3 using the putObject method of the S3 instance.
92
+
93
+
N> Replace **Your Bucket Name** with the actual Bucket name of your AWS S3 account and **Your Key** with the actual File Key of your AWS S3 account.
N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example.
123
+
124
+
[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).
125
+
126
+
## Using Server-Backed PDF Viewer
127
+
13
128
To save a PDF file to AWS S3 bucket, you can follow the steps below
14
129
15
130
**Step 1:** Create AWS S3 account
@@ -90,4 +205,4 @@ Set the `documentPath` property of the PDF viewer component to the desired name
Copy file name to clipboardExpand all lines: ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-amazon-s3.md
+81-1Lines changed: 81 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,86 @@ documentation: ug
10
10
11
11
# Open PDF file from AWS S3
12
12
13
+
PDF Viewer allows to load PDF file from AWS S3 using either the Standalone or Server-backed PDF Viewer. Below are the steps and a sample to demonstrate how to open a PDF from AWS S3.
14
+
15
+
## Using Standalone PDF Viewer
16
+
17
+
To load a PDF file from AWS S3 in a PDF Viewer, you can follow the steps below
18
+
19
+
**Step 1:** Create AWS S3 account
20
+
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
+
23
+
**Step 2:** Create PDF Viewer Sample in ASP.NET Core
24
+
25
+
Follow instructions provided in the Syncfusion PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample in ASP.NET Core.
26
+
27
+
**Step 3:** Modify the `~/Pages/Shared/_Layout.cshtml` File in the Project
28
+
29
+
1. Add the required scripts using CDN inside the `<head>` of `~/Pages/Shared/_Layout.cshtml` file as follows,
**Step 4:** Modify the `~/Pages/Index.cshtml` File in the Project
43
+
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
+
46
+
N> Replace **Your Region** with the actual Region of your AWS S3 account and **Your Access Key** with the actual Access Key of your AWS S3 account and **Your Security Access Key** with the actual Security Access Key of your AWS S3 account.
47
+
48
+
```csharp
49
+
AWS.config.update({
50
+
region:'**Your Region**', // Update this your region
51
+
accessKeyId:'*Your Access Key*', // Update this with your access key id
52
+
secretAccessKey:'*Your Security Access Key*', // Update this with your secret access key
53
+
});
54
+
```
55
+
56
+
2. Sets the parameters for fetching the PDF document from S3, including the bucket name and file key. Then Uses the getObject method of the S3 instance to retrieve the document. Converts the document data to a Base64 string and loads it into the Syncfusion PDF Viewer then load Base64 string generated into the viewer.load method.
57
+
58
+
N> Replace **Your Bucket Name** with the actual Bucket name of your AWS S3 account and **Your Key** with the actual File Key of your AWS S3 account.
N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example.
88
+
89
+
[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).
90
+
91
+
## Using Server-Backed PDF Viewer
92
+
13
93
To load a PDF file from AWS S3 in a PDF Viewer, you can follow the steps below
14
94
15
95
**Step 1:** Create AWS S3 account
@@ -132,4 +212,4 @@ Set the `documentPath` property of the PDF viewer component to the desired name
132
212
133
213
N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example.
134
214
135
-
[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3)
215
+
[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%20Server-Backend)
0 commit comments