- Go to Adobe PDF Embed API Integration.
- Register or log in to your account.
- Enter your credentials, domain of your app, agree to developer terms, and press “Create credentials”.
- Copy the CLIENT ID (API KEY) that you received and paste it into
appsettingsunder the keyAdobeAPIToken.
- Visual Studio
- .NET Hosting Bundle
- Clone the repository.
- Open the repository with your preferred IDE (For guide purposes, I will use Visual Studio).
- Go to
appsettings.jsonand fill in the path where notes should be stored on the server (NotesFolder) and paste your Adobe token intoAdobeAPIToken. - Publish the solution. (For detailed instructions, see "Publishing with Visual Studio" below)
- Open up IIS.
- Expand connections list, right click on "Sites" and press "Add website".
- Choose a name for the website, ex. "SharingAPI". Then, for physical path, pick the location where you published the project to. In the Binding section, choose whatever you want to host it under. Then, press OK.
- Right click on the project solution and press Publish.
- In the Publish window, press "Add a publish profile".
- Select "Folder" and press next.
- Pick the location where you want to publish the solution.
- Press "Finish", and then "Close".
- Now, press "Publish" next to the generated publish profile.
To enable CORS (Cross-Origin Resource Sharing) on an IIS server, you can add CORS headers to the web.config file of your website or application. This allows the server to specify which origins are permitted to access its resources.
- IIS CORS Module installed: Instalation link
-
Access web.config: Locate and access the
web.configfile for your website or application. This file is typically located in the root directory of your application. -
Edit web.config: Open the
web.configfile using a text editor. -
Add CORS Configuration: Inside the
<system.webServer>section of theweb.configfile, add the following XML configuration to enable CORS and specify the desired CORS headers. Example:<?xml version="1.0" encoding="utf-8"?> <configuration> <location path="." inheritInChildApplications="false"> <system.webServer> <cors enabled="true" failUnlistedOrigins="true"> <add origin="*"> <allowMethods> <add method="GET" /> <add method="POST" /> <add method="PUT" /> <add method="DELETE" /> </allowMethods> </add> </cors> </system.webServer> </location> </configuration>
In the above example:
enabled="true"enables CORS support.failUnlistedOrigins="true"specifies that requests from origins not listed in the configuration should fail.<add origin="*">allows requests from any origin.<allowMethods>specifies the allowed HTTP methods (GET, POST, PUT, DELETE).- '*'
<allowHeaders>specifies the allowed request headers. - '*'
<exposeHeaders>specifies the headers that the server exposes to the client.
'*' - optional tags
-
Save Changes: After adding the CORS configuration to the
web.configfile, save the changes. -
Restart IIS: To apply the changes, restart the IIS server. You can do this by selecting the server node in the IIS Manager and clicking "Restart" under the Manage Server section.
Once these steps are completed, the IIS server will include the specified CORS headers in its responses, allowing cross-origin requests for the specified HTTP methods.
In the releases, there is an already published current version of the API with sample notes folder set up.
Unpack it into your site's location and modify appsettings.json and web.config according to your needs.
API server should now be correctly set up.