Setup WebViewer Angular Sample on IIS

18 views
Skip to first unread message

Oscar Zhang

unread,
Mar 4, 2021, 5:19:24 PM3/4/21
to PDFTron WebViewer
Q:

I have tried to start with WebViewer Angular project template (https://github.com/PDFTron/webviewer-angular-sample.git). But I had a hard time deploying this to IIS Server, Are there any step-by-step instructions that I can follow?

A:
(The following steps are running on  IIS 10)
  1. Install URL Rewrite tool for IIS: https://devblogs.microsoft.com/premier-developer/tips-for-running-an-angular-app-in-iis/#troubleshooting
  2. Add Virtual Directory to IIS
  3. In virtual directory physical path, run `git clone https://github.com/PDFTron/webviewer-angular-sample.git .` 
  4. Add web.config directly to the folder above, using this content https://devblogs.microsoft.com/premier-developer/tips-for-running-an-angular-app-in-iis/#add-web-config-file-with-a-url-rewrite-rule Remember to change url="/MyApp/" to new path location
  5. Run `npm install` to get all dependencies to be installed
  6. Run "ng build --base-href='/YOUR_URL/'"
  7. Copy contents of "Dist/Angular/" folder to this folder (beside web.config)
  8. Copy the "lib" and "files" folders to your "inetpub/wwwroot" folder (otherwise I got 404 errors in the browser)
  9. Goto "localhost/yoururl"
  10. The WebViewer should be running in your browser now
Reply all
Reply to author
Forward
0 new messages