pedro-lucas / node-pdfbox

Node bridge module to library PDFBox
MIT License
19 stars 13 forks source link

Filling out forms #1

Closed Taakn closed 8 years ago

Taakn commented 8 years ago

Hello,

I was wondering if your package could fill out forms.

Thanks so much

pedro-lucas commented 8 years ago

Hello Taakn,

Could you send to me a pdf to fill out?

I need to a example to use as reference.

pedro-lucas commented 8 years ago

I will use the link below to simulate the new feature to the library.

http://foersom.com/net/HowTo/data/OoPdfFormExample.pdf

Taakn commented 8 years ago

Hi @pedro-lucas here's a complex example (it's in French): https://www.formulaires.modernisation.gouv.fr/gf/cerfa_13959.do

You'll notice that some of the trickier parts besides the drop downs and checkboxes that you already have in your document are the COMB fields: the fields that have a set number of characters displayed in adjacent boxes (for example a date or a SSN).

Some of the pdf documents processors out there such as pdftk / pdffiller do not handle a lot of these cases well, so if you manage to get this working that would be fantastic. The other issue is to be able as an option to FLATTEN the document, meaning fill out the form and make it read only.

Thanks a lot for your help, I can help you test your package.

pedro-lucas commented 8 years ago

I'm creating the new classes to manipulate the fields and making new tests.

I think in one week I will submit the new version 0.0.9 with the new features.

New features

Taakn commented 8 years ago

That's very cool :)

pedro-lucas commented 8 years ago

Please take a look in this file: https://github.com/pedro-lucas/node-pdfbox/blob/development/examples/fill-out-forms/index.js

Try it and give me a feedback please.

pedro-lucas commented 8 years ago

You can take this changes in development branch.

pedro-lucas commented 8 years ago

Please, check the version 0.0.9.

Thank you!

Taakn commented 8 years ago

Hey sorry I've been putting code through production and I've been running into a bunch of issues so unfortunately dealing with that. I will look at your code as soon as I have some time. Thanks again and sorry for the delay in replying to your messages!