Mirage
Mirage

Reputation: 31548

What is the best way to fill the pdf form with pdftk in python django

I have two forms

  1. One for uploading the PDF templates of unfilled form
  2. Other for submitting the filled data

Now my team leader told me that i have to save the file for template case but when user submits the filled form then i need to extract the data from pdf file with pdftk and then when user wants to download it i have to refill the form with that data.

Currenlly i am using

pdftk sample.pdf dump_data_feilds

and i am saving that fields to the database.

now i don't know how can i regenerate the pdf from the template with that data.

how should i proceed

Upvotes: 1

Views: 1934

Answers (1)

Mirage
Mirage

Reputation: 31548

You need FDFGEN to create FDF from from the fields

You can generate PDF from the FDF previously generated with PDFTK

pdftk form.pdf fill_form data.fdf output output.pdf flatten

Upvotes: 2

Related Questions