I am trying to set up the document viewer to view the sample doc file included in the .net core example. I have copied the javascript files from the example and set up my program.cs as the documentation suggests and the example shows.
The document viewer does not appear. Using the developer view we can see the errors:
“Uncaught TypeError: $(…).docViewer is not a function
at docViewer.UI.js:114:34”
and
“Uncaught TypeError: $(…).dropzone is not a function
at HTMLDocument. (docViewer.UI.js:201:24)”
Debugging in visual studio confirms that these functions are indeed not running.
The “dropzone” is a javascript library used on the viewer sample, but it has nothing to do with doconut software library. You can disable or remove it and use a classic upload file.
There are tons of websites dedicated to dropzone where you can get a better guide for the Dropzone library. For example https://www.dropzone.dev/
In another scenario, you can remove it altogether, as it is not a requirement or part of the Doconut library.
Thank explains what to do with “dropzone”. The bigger issue is the “docViewer” function not working. It’s my understanding that that is the function that is opening the file for viewing.
I am sorry. I realize I only replied to the later question.
It is hard to figure out what you are missing, the easiest would be to compare your source code with one of the Net Core working samples, but I will copy and paste here what are the scripts we used in the .Net Core samples:
Okay, it is an issue with that particular project, not the library.
Now it rings a bell that dropzone did not work. It may be something wrong with that particular project.
I would start by adding another external library(javascript) and check if it works, not a function, but a complete library. If it fails, we know where the issue is. How to solve that is up to you since it can be anything, how you set up your MVC path, or routing, which is affecting the UI.
Also, I would create a brand new MVC project, empty. Create a controller with a view. Start adding some backend code and then frontend(adding the js libraries and see if it works) and test that out.
You can also create an MVC default project and change the index page with the code of the sample and see if it works.
This is only the case if you are working on a brand-new project. If you are working on an existing one, you must check what is wrong. But as we tested with the demos, it is not the libraries.
You can also try adding a new MVC Project in the same solution and check if it works.
I was able to add a different javascript library to my project with no issue.
I tried completing a completely new project, following the integration guide and copying in the index and javascript libraries from the demo and I got the same issue.
Okay, since it is not a problem from the project, we have to try to figure out what can be.
I haven’t heard anyone else have this issue besides you, so it looks like it is not a bug or the complaints about this would be done by everyone.
If you remove the DLLs, how much is the new project zipped? Maybe you can upload it somewhere so can download it, and then I can review it. I am talking about the new project, which should have no sensible or private data. I do not need the license or the DLLs, just the source code of the new project.
Also, have you run the code on a different machine? have you tried using IIS Express and IIS?
Just trying to figure out what may be the source of the issue.