This is Form fields not appearing after 4 pages continued. @Logan I tried 7.1.1 and 7.1.2, it fixed the zoom issue, but the form field issue is back. If you try with the PDF I attached in #294, you can reproduce the issue (the form fields are not coming after page 1 there are form fields in page 3, 5, 7, 9 etc.). Also there is a new bug, when the code tries to assign value to the form field:
TypeError: Cannot read property 'struct' of undefined
at PDFJSDocumentType.js:2278
at PDFJSDocumentType.js:2300
error @ PDFJSDocumentType.js:99
Not sure from where the error occurs, but the form fields are not updating with new values assigned by the application code (in 6.3.2 and 7.1.0, there was no issue for the same code). This is the code that is in the application:
I cannot reproduce any of your issues in 7.1.2 on the document linked in #294 (MAWB8CopiesF.pdf).
When you change version, can you please make sure all files from the old version are deleted and the cache is clear. Sometimes files not getting overwritten can cause issues. We actually recommend changing the folder WebViewer is served from based on the version. So instead of /lib/pdfjsexpress, you would do something like /lib/pdfjsexpress/7.1.2/
You may also run into issues if you try setting the form fields before annotations are done loading. Make sure you wait for the annotationsLoaded event before setting form fields.
You have to copy the files for 7.1.2 at public/webviewer/7.1.2 folder and you will be able to see both issues I am saying. If you want I can remove the gitignore and add those files as well.
If you change the path to /webviewer/lib in src/App.js you will be able to see the values being correctly replaced.
First of all, thank you so much for the repo, that helps us a lot!
There is a couple things going on here. Firstly, Express is getting imported into the project twice, once in public/index.html and once in src/App.js, which can cause issues. Removing the script tag from index.hrml removed some of the errors that were getting thrown.
There’s also another error getting thrown, Cannot read property 'struct' of undefined at certain screen sizes. This is a known issue and will be fixed in the next release. I believe this is what is causing the form fields to not display sometimes.
A decent workaround for now is disabling the FitWidth fit mode, so commenting out this line: instance.setFitMode(FitMode.FitWidth);
@Logan I actually forked from pdfjsexpress example react repo https://github.com/pdfjs-express/pdfjs-express-react-sample, so was not aware of the script tag being imported twice. Also, for our users, it is not usable without FitWidth or atleast a good zoom level as the default fit mode is too small to input anything to the form fields
Even without fitmode, there is a lag in the form to render with values.