- Install Node.js if you don't already have it
- Install Yarn if you don't already have it
- Clone the
AcroForms
branch of the pdf-lib library:
git clone -b AcroForms https://github.com/Hopding/pdf-lib.git
- Enter the directory:
cd pdf-lib
- Install the required packages:
yarn install
- Build the library:
yarn build
- Print the current working directory by typing
pwd
(orcd
if you're on Windows) - Clone this project:
git clone https://github.com/ricky-sb/PDF-Filler
- Enter the directory:
cd PDF-Filler
- Copy the path from Step 7 into Line 7 of this project's package.json file
- Run
node build/form.js
to fill out the form - Open
output.pdf
to see your results
- Yes, we have to manually compile
pdf-lib
becauseAcroForms
hasn't been packaged/released yet. It should happen within the next few weeks. - See
src/form.ts
for the implementation. It should give you an idea of a path forward. - I got the magic string
topmostSubform[0].Page4[0].TextField1[2]
from looking at the form field properties in PDFEscape.- Load the PDF into PDFEscape
- Right click one of the form fields and click "Unlock Form Field"
- Accept the confirmation dialog by pressing "Yes"
- Right click the same form field and click "Object Properties"
- Copy the name from the "Name" section