pdfjs
pdfjs copied to clipboard
enable tree shaking?
I'd like to add better tree shaking support to pdfjs. This, however, might require major API changes. Currently, when importing pdfjs, support for images, tables, etc loaded. Instead, it would be nice, if only the things are loaded (and thus added to a potential browser bundle) that are actually being used. E.g. when only using text, don't load the stuff required to draw images.
The API would have to change from
doc.text('Lorem ...')
to
import { Text } from 'pdfjs'
doc.add(new Text('Lorem ...'))
For now, I am not sure if I am going this way. Feedback/Suggestions are welcome. This change would enable #87 (pdfjs currently has a lot of circular dependencies which are blocking es6 modules for now).