Giter Site home page Giter Site logo

martymm / hello-prizmdoc-viewer-with-dotnet-and-html Goto Github PK

View Code? Open in Web Editor NEW

This project forked from accusoft/hello-prizmdoc-viewer-with-dotnet-and-html

0.0 1.0 0.0 3.67 MB

A minimal ASP.NET Core web application which integrates PrizmDoc Viewer.

License: Other

C# 2.56% HTML 0.92% CSS 12.11% JavaScript 84.41%

hello-prizmdoc-viewer-with-dotnet-and-html's Introduction

Hello PrizmDoc Viewer with ASP.NET Core and HTML

A minimal ASP.NET Core web application which integrates PrizmDoc Viewer.

Pre-Requisites

For the Command Line

For Visual Studio

For Visual Studio Code

For Visual Studio for Mac

Setup

Configure the Application to Connect to PAS

Configure how to connect to PAS (PrizmDoc Application Services) by editing MyWebApplication/appsettings.json (or via any of the other ways that ASP.NET Core allows you to provide configuration).

Use PrizmDoc Cloud (Easiest)

If you're just getting started, the easiest thing to do is to use PrizmDoc Cloud. We host PAS for you and all you need is your PrizmDoc Cloud API key. If you don't have an API key, you can get one for free at https://cloud.accusoft.com.

For PrizmDoc Cloud, your appsettings.json will need to contain a section like this:

  "PrizmDoc": {
    "PasBaseUrl": "https://api.accusoft.com/prizmdoc/",
    "CloudApiKey": "YOUR_API_KEY"
  }

Where YOUR_API_KEY is your PrizmDoc Cloud API key.

Note: If you'd rather not store your API key within appsettings.json, the MyWebApplication project has been pre-configured for use with the dotnet user-secrets command-line tool. You can use this tool to configure a "PrizmDoc:CloudApiKey" value for just your dev machine like so:

dotnet user-secrets set "PrizmDoc:CloudApiKey" "YOUR_API_KEY" --project MyWebApplication

Host PAS Yourself (Advanced)

If you are self-hosting your own PAS instance, your appsettings.json will be configured slightly differently:

  "PrizmDoc": {
    "PasBaseUrl": "YOUR_PAS_BASE_URL",
    "PasSecretKey": "YOUR_PAS_SECRET_KEY"
  }

The PasBaseUrl should be the base URL for requests to your PAS instance (like "http://localhost:3000/").

The PasSecretKey must match the secretKey value specified in your PAS config file.

Note: If you'd rather not store your secret key within appsettings.json, the MyWebApplication project has been pre-configured for use with the dotnet user-secrets command-line tool. You can use this tool to configure a "PrizmDoc:PasSecretKey" value for just your dev machine like so:

dotnet user-secrets set "PrizmDoc:PasSecretKey" "YOUR_PAS_SECRET_KEY" --project MyWebApplication

Running the Sample

To start the application from the command line:

dotnet run --project MyWebApplication

This will launch a small web application on http://localhost:5000.

If you have configured your connection to PAS correctly, you should see output like this:

info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\jdoe\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
Hosting environment: Development
Content root path: C:\Users\jdoe\source\hello-prizmdoc-viewer-with-dotnet-and-html\MyWebApplication
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.

When you visit http://localhost:5000, you should see a viewer with an example document, like this:

hello-prizmdoc-viewer-with-dotnet-and-html's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.