Skip to content

Commit be1a43c

Browse files
Update Salesforce example. (#9)
* Rename everything to Nutrient. * Fix syntax. * Version number updates. * Ignore Salesforce for linting.
1 parent e1f7916 commit be1a43c

29 files changed

+242
-199
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ open-iconic
99
.next/
1010
.nuxt/
1111
dist/
12-
analytics.js
12+
analytics.js
13+
.DS_Store

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"./examples/blazor/wasm/wwwroot/css/*",
88
"./examples/wasm-benchmark/*",
99
"./examples/asp-net/*",
10-
"./examples/svelte-kit"
10+
"./examples/svelte-kit",
11+
"./examples/salesforce/*"
1112
],
1213
"ignoreUnknown": true
1314
},

examples/salesforce/README.md

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
# PSPDFKit for Salesforce Integration
1+
> ⚠️ **Repository Moved**
2+
> This repository has been moved to https://github.com/PSPDFKit/nutrient-web-examples/tree/main/examples/salesforce.
3+
> Please update your bookmarks and issues accordingly.
4+
>
5+
> This repo is now archived and will no longer receive updates.
6+
7+
# Nutrient Salesforce SDK Integration
28

39
## Integrate into a New Salesforce Project as a Lightning Web Component
410

5-
PSPDFKit for Salesforce enables you to open PDF, JPG, PNG, and TIFF files inside Salesforce. This unlocks the full functionality of PSPDFKit in Salesforce, including PDF generation, redaction, and signatures.
11+
Nutrient Salesforce SDK enables you to open PDF, JPG, PNG, and TIFF files inside Salesforce. This unlocks the full functionality of Nutrient Web SDK in Salesforce, including PDF generation, redaction, and signatures.
612

7-
This README explains how to integrate PSPDFKit into a new Salesforce project. The integration works as a [Lightning web component (LWC)][lwc] that you can add to any Salesforce organization.
13+
This README explains how to integrate Nutrient Web SDK into a new Salesforce project. The integration works as a [Lightning web component (LWC)][lwc] that you can add to any Salesforce organization.
814

9-
For more information on integrating PSPDFKit into an existing Salesforce project, see the [PSPDFKit for Salesforce documentation][salesforce docs].
15+
For more information on integrating Nutrient Web SDK into an existing Salesforce project, see the [Nutrient Salesforce SDK documentation][salesforce docs].
1016

11-
PSPDFKit for Salesforce shares the same APIs as Nutrient Web SDK Standalone. For more information on customizing your Salesforce application, see the [Nutrient Web SDK Standalone documentation][web docs].
17+
Nutrient Salesforce SDK shares the same APIs as Nutrient Web SDK Standalone. For more information on customizing your Salesforce application, see the [Nutrient Web SDK Standalone documentation][web docs].
1218

1319
## Requirements
1420

@@ -21,17 +27,17 @@ Before continuing, perform all of the following actions:
2127

2228
## Deploying the Package
2329

24-
To deploy the PSPDFKit package to your Salesforce organization, follow these steps.
30+
To deploy the Nutrient Web SDK package to your Salesforce organization, follow these steps.
2531

26-
1. Download the [PSPDFKit for Salesforce project][zip] from GitHub, and then unpack the ZIP file.
32+
1. Download the [Nutrient Salesforce SDK project][zip] from GitHub, and then unpack the ZIP file.
2733

28-
Alternatively, run the following terminal command to clone the [PSPDFKit for Salesforce repository][repo] from GitHub:
34+
Alternatively, run the following terminal command to clone the [Nutrient Salesforce SDK repository][repo] from GitHub:
2935

3036
```bash
3137
git clone https://github.com/PSPDFKit/salesforce.git
3238
```
3339

34-
2. In the terminal, go to the PSPDFKit for Salesforce project folder and run the following command to install the PSPDFKit npm module.
40+
2. In the terminal, go to the Nutrient Salesforce SDK project folder and run the following command to install the Nutrient Web SDK npm module.
3541

3642
Use the following code for npm:
3743

@@ -45,15 +51,15 @@ To deploy the PSPDFKit package to your Salesforce organization, follow these ste
4551
yarn install
4652
```
4753

48-
3. The PSPDFKit for Salesforce integration example now makes use of the PSPDFKit version available from our CDN at https://cdn.cloud.pspdfkit.com/pspdfkit-web, which means it's no longer limited by Salesforce's upload assets size 5MB limit.
54+
3. The Nutrient Salesforce SDK integration example now makes use of the Nutrient Web SDK version available from our CDN at https://cdn.cloud.pspdfkit.com/pspdfkit-web, which means it's no longer limited by Salesforce's upload assets size 5MB limit.
4955

50-
In order to set the PSPDFKit version you want to use, open `./force-app/main/default/pages/PSPDFKit_InitPSPDFKit.page` and edit the line 7 to reflect the PSPDFKit version. For example, in order to use version 2024.4.0, you should change the URL pointing to the CDN to:
56+
In order to set the Nutrient Web SDK version you want to use, open `./force-app/main/default/pages/Nutrient_InitNutrient.page` and edit the line 7 to reflect the Nutrient Web SDK version. For example, in order to use version 1.0.0, you should change the URL pointing to the CDN to:
5157

5258
```html
53-
<script src="https://cdn.cloud.pspdfkit.com/pspdfkit-web@2024.4.0/pspdfkit.js" type="text/javascript"></script>
59+
<script src="https://cdn.cloud.pspdfkit.com/pspdfkit-web@1.0.0/nutrient-viewer.js" type="text/javascript"></script>
5460
```
5561

56-
You can find the latest version of Nutrient Web SDK in the [PSPDFKit changelog](https://www.nutrient.io/changelog/web/).
62+
You can find the latest version of Nutrient Web SDK in the [Nutrient Web SDK changelog](https://www.nutrient.io/changelog/web/).
5763

5864
4. Run the following command in the terminal to start the Salesforce authentication process:
5965

@@ -63,47 +69,47 @@ In order to set the PSPDFKit version you want to use, open `./force-app/main/def
6369

6470
5. In the browser window that opens, log in to your Salesforce organization and authorize the Salesforce CLI.
6571

66-
6. In the terminal, run the following command from the PSPDFKit for Salesforce project’s root folder:
72+
6. In the terminal, run the following command from the Nutrient Salesforce SDK project’s root folder:
6773

6874
```bash
6975
sfdx force:source:deploy -x manifest/package.xml
7076
```
7177

72-
## Enabling Users to Use PSPDFKit
78+
## Enabling Users to Use Nutrient Web SDK
7379

74-
To enable users of your Salesforce organization to use PSPDFKit, follow these steps.
80+
To enable users of your Salesforce organization to use Nutrient Web SDK, follow these steps.
7581

7682
1. In Salesforce, go to **Users** > **Permission Sets**.
7783

78-
2. Find **PSPDFKit Admin Access** in the list and click it.
84+
2. Find **Nutrient Admin Access** in the list and click it.
7985

8086
3. Click **Manage Assignments**.
8187

8288
4. Click **Add Assignment**.
8389

84-
5. Select the users you want to authorize to use PSPDFKit.
90+
5. Select the users you want to authorize to use Nutrient.
8591

8692
6. Click **Next**, and then click **Assign**.
8793

8894
## Changing the Security Settings
8995

90-
PSPDFKit for Salesforce requires Lightning Locker to protect Lightning web components, but Salesforce uses Lightning Web Security by default. To change the default security settings, follow these steps.
96+
Nutrient Salesforce SDK requires Lightning Locker to protect Lightning web components, but Salesforce uses Lightning Web Security by default. To change the default security settings, follow these steps.
9197

9298
1. In Salesforce, go to **Security** > **Session Settings**.
9399

94100
2. Deselect **Use Lightning Web Security for Lightning web components**.
95101

96102
3. Scroll down and click **Save**.
97103

98-
## Using the PSPDFKit for Salesforce Integration
104+
## Using the Nutrient Salesforce SDK Integration
99105

100-
To use PSPDFKit in your Salesforce organization, follow these steps.
106+
To use Nutrient Web SDK in your Salesforce organization, follow these steps.
101107

102-
1. Ensure you’re logged in as a user authorized to use PSPDFKit.
108+
1. Ensure you’re logged in as a user authorized to use Nutrient Web SDK.
103109

104110
2. In the top-right corner, open the App Launcher.
105111

106-
3. Search for and select **PSPDFKit**.
112+
3. Search for and select **Nutrient**.
107113

108114
4. Click **browse** to upload local PDF files, or open a file from Salesforce.
109115

examples/salesforce/force-app/main/default/classes/PSPDFKitController.cls renamed to examples/salesforce/force-app/main/default/classes/NutrientController.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
global with sharing class PSPDFKitController {
1+
global with sharing class NutrientController {
22
public static contentVersion contVersion{get;set;}
33
public static String conbase{get;set;}
44

@@ -47,4 +47,4 @@ global with sharing class PSPDFKitController {
4747
}
4848
}
4949

50-
}
50+
}

examples/salesforce/force-app/main/default/classes/PSPDFKitController.cls-meta.xml renamed to examples/salesforce/force-app/main/default/classes/NutrientController.cls-meta.xml

File renamed without changes.

examples/salesforce/force-app/main/default/classes/PSPDFKitControllerTest.cls renamed to examples/salesforce/force-app/main/default/classes/NutrientControllerTest.cls

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@IsTest
2-
public class PSPDFKitControllerTest {
2+
public class NutrientControllerTest {
33

44
@testSetup static void setup() {
55
Account testAccts = new Account(Name = 'TestAcct');
@@ -27,7 +27,7 @@ public class PSPDFKitControllerTest {
2727
static void testGetAttacmentDetails() {
2828
Account act = [SELECT id FROM Account];
2929
Test.startTest();
30-
List <ContentDocument> conDocList = PSPDFKitController.getAttachmentDetails(act.Id);
30+
List <ContentDocument> conDocList = NutrientController.getAttachmentDetails(act.Id);
3131
Test.stopTest();
3232
System.assertEquals(1,conDocList.size());
3333
}
@@ -37,7 +37,7 @@ public class PSPDFKitControllerTest {
3737
Account act = [SELECT id FROM Account];
3838
ContentDocumentLink docLink = [SELECT contentDocumentId From ContentDocumentLink where LinkedEntityId=:act.Id];
3939
Test.startTest();
40-
Map<String,String> base64Data = PSPDFKitController.getbase64Data(docLink.contentDocumentId);
40+
Map<String,String> base64Data = NutrientController.getbase64Data(docLink.contentDocumentId);
4141
Test.stopTest();
4242
System.assertEquals(3,base64Data.size());
4343
}
@@ -48,13 +48,13 @@ public class PSPDFKitControllerTest {
4848
ContentDocumentLink docLink = [SELECT contentDocumentId From ContentDocumentLink where LinkedEntityId=:act.Id];
4949
Test.StartTest();
5050
ApexPages.StandardController sc = new ApexPages.StandardController(docLink);
51-
PSPDFKitController testAccPlan = new PSPDFKitController();
51+
NutrientController testAccPlan = new NutrientController();
5252

53-
PageReference pageRef = Page.PSPDFKit_InitPSPDFKit;
53+
PageReference pageRef = Page.Nutrient_InitNutrient;
5454
pageRef.getParameters().put('id', String.valueOf(docLink.contentDocumentId));
5555
Test.setCurrentPage(pageRef);
5656

5757
testAccPlan.getFileDetail();
5858
Test.StopTest();
5959
}
60-
}
60+
}

examples/salesforce/force-app/main/default/classes/PSPDFKitControllerTest.cls-meta.xml renamed to examples/salesforce/force-app/main/default/classes/NutrientControllerTest.cls-meta.xml

File renamed without changes.

examples/salesforce/force-app/main/default/labels/CustomLabels.labels-meta.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<language>en_US</language>
66
<protected>true</protected>
77
<shortDescription>Button label</shortDescription>
8-
<value>Edit File with PSPDFKit</value>
8+
<value>Edit File with Nutrient</value>
99
</labels>
1010
</CustomLabels>
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
{
2-
"compilerOptions": {
3-
"experimentalDecorators": true
4-
},
5-
"include": ["**/*", "../../../../.sfdx/typings/lwc/**/*.d.ts"],
6-
"paths": {
7-
"c/*": ["*"]
8-
},
9-
"typeAcquisition": {
10-
"include": ["jest"]
11-
}
2+
"compilerOptions": {
3+
"experimentalDecorators": true
4+
},
5+
"include": [
6+
"**/*",
7+
"../../../../.sfdx/typings/lwc/**/*.d.ts"
8+
],
9+
"paths": {
10+
"c/*": [
11+
"*"
12+
]
13+
},
14+
"typeAcquisition": {
15+
"include": [
16+
"jest"
17+
]
18+
}
1219
}

examples/salesforce/force-app/main/default/lwc/pspdfkitEditButtonSolution/pspdfkitEditButtonSolution.html renamed to examples/salesforce/force-app/main/default/lwc/nutrientEditButtonSolution/nutrientEditButtonSolution.html

File renamed without changes.

0 commit comments

Comments
 (0)