-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using fewer codepages? #41
Comments
From the spec: |
@zoehneto - I am also interested in using this library but it currently would double the size of our deployment bundle. How hard would it be to do what you described above so that I could provide only the code page that I need? |
In theory you'd only have to add the library to the webpack externals, remove the include from the dev / prod config and add a peer dependency to the package.json (on the rtf.js side, you'd still need to adapt your config to provide codepagejs appropriately). I currently don't have time to look further into it, but I'd be happy about a PR, if you want to implement the feature. |
I will take a look and see if its something I can do quickly or if I run into any roadblocks. 👍🏼 |
I attempted to do this but ran into issues, mainly because this package was designed to be available in the browser, and the codepage tables are baked in. What I played with is on this branch: https://github.com/lounsbrough/rtf.js/tree/extract-codepage. I think someone more familiar with the app would need to address, or decide what the best path is. |
According to the RTF spec (https://www.microsoft.com/en-us/download/details.aspx?id=10725), there are only a few codepages needed in RTF:
As far as I can tell, rtf.js supports 145 code pages (searching for
cptable[###] =
in the RTFJS.bundle.js file), and eliminating ones that aren't necessary could cut down the bundle file size substantially.The text was updated successfully, but these errors were encountered: