Product Version: 9.2.0-1
Please give a brief summary of your issue:
During deployment, calls to PDFNet function returns error.
Please describe your issue and provide steps to reproduce it:
I have used PDFNet-node to edit a PDF document and everything works fine on my local machine (developed on Windows x64) but for testing, when I deploy it on a server (Linux x64), I first get an error named “Cannot find module ‘./addon’”. On refresh and subsequent request, I get the Error “Cannot read property ‘addEventListener’ of undefined”.
Edit: I found that the addEvent Listener part is because a messageHandler was also undefined. Upon replacing the undefined with empty objects and functions, I can see that the actual error is still that it could not find the module ‘./addon’;
After research, I am aware that the binaries for the two operating systems are different. I ran “npm install @pdfftron/pdfnet-node --target_arch=x64 --target_platform=linux” to get the PDFNetC.so file linux version of addon.node. I put these two files on the same directory as my index.js (the project is using webpack). I also tried multiple variations keeping both PDFNetC.dll and PDFNetC.so and using the corresponding addon.node file.
My current thought is to go into the pdfnet.js file, find the lines giving the error and disable them if they are not necessary but without the overall understanding, I think it can get quite messy and buggy. Hope you can provide me with some insight about why this occurs and how it could be solved.
If I should put some specific files somewhere, I would appreciate it if you could attach the link to them.
Thank you in advance.