Search Unity

Angular + PDF Reader Asset + WebGL = NOT WORKING!!!

Discussion in 'Web' started by LurchUSA, Jun 20, 2019.

  1. LurchUSA

    LurchUSA

    Joined:
    Sep 20, 2017
    Posts:
    21
    I am building a Unity WebGL project, that reads a PDF and displays it on a texture using the PDF Reader asset, for a co-worker who is developing an Angular 8 website.

    We have had successful WebGL sites run with vanilla JavaScript and AngularJS pages, but we can't get this combination of technologies to work.

    The main problem is that the PDF Reader puts the files:
    - pdf.js
    - pdf.worker.js

    Into the same folder as the index.html. When we run the Angular project with ng serve, the browser is reporting:

    http://localhost:4200/pdf.js - Error 404, File Not Found.

    So far I can't see any code that has path references to either PDF file, so I'm assuming that's built into WebGL.data.unityweb, since I can't those file names within the UnityLoader.js file.

    At this stage I need help, to find out what code is trying to load these PDF files and if I can somehow change the code to point to another path that is compatible with the Angular run-time.

    Any hints, pointers or suggestions greatly appreciated.