Hopding / pdf-lib

Create and modify PDF documents in any JavaScript environment
https://pdf-lib.js.org
MIT License
6.9k stars 657 forks source link

interactive editing? #67

Closed waspinator closed 5 years ago

waspinator commented 5 years ago

Is there a plan to support integration with pdf.js or some other viewer to allow for interactive editing? i.e. adobe acrobat in a browser.

an old project: https://github.com/instructure/pdf-annotate.js

Hopding commented 5 years ago

Hello @waspinator.

I don't think pdf-lib would be the place to implement functionality like this. All of the code in the pdf-lib repo is intended to be environment-agnostic. It should work in any JavaScript environment, whether that be a browser, NodeJS, React Native, etc.. A feature like this would require extensive interaction with the DOM (which is, of course, browser-specific).

That being said, I'd be willing to consider adapting pdf-lib in order to make it easier to integrate with. But I've only thought about this briefly, so I'm not sure exactly what that would look like.

I could definitely see a new project being built on top of pdf.js and pdf-lib to support interactive editing. pdf.js would be the rendering layer, and pdf-lib would be the (de)serialization layer. I think most of the work would be in connecting the two layers together, and developing the interactive UI.

louisxie0830 commented 5 years ago

Could it support PDF digital signatures?

Hopding commented 5 years ago

Hello @louisxie0830. Are you talking about adding/filling PDF signature fields? If so, then the answer is yes. pdf-lib supports acroform manipulation. See here and here for more info. Let me know if you have any questions!