Closed sschmidTU closed 4 years ago
IMO the acroform module shouldn't even register any classes to the global namespace since they are always available via jsPDF. For backward compatibility we should keep it, though. But I guess we can at least remove the warning entirely. I think there are very few use cases where this warning is helpful compared to the amount of false positives.
Can you prepare a pull request?
Yes, registering to global namespace is a bit unideal because it can also create conflicts when different versions are used simultaneously.
Thanks for the consideration! I created PR #32.
When using svg2pdf, which depends on jspdf, i always get this warning in the console right in the import phase:
I know this is not entirely jspdf's fault, it's probably due to svg2pdf importing jspdf, and if you want to use svg2pdf, you have to import jspdf as well, in which case the AcroForm classes are already added.
But I see no way to prevent this warning from appearing, since it occurs during imports/requires, and it would be unfortunate if i have to see this warning for the rest of my days when using jspdf and another package that imports jspdf.
Is this warning actually helpful for anyone? Can't it be removed, or saved and then only output if an option is set to show such warnings? Maybe we can save which version of jspdf was adding the classes and only warn if two different versions try to add different AcroForm classes?
I know this isn't the most pleasant kind of issue, but thanks for your consideration.