0

First, I am trying to use Python to dynamically enter data into a secured PDF file, that I downloaded from a government source. I DO NOT have the password to unprotect them, but can open them with a PDF reader and enter data. I have tried using pdftk and an FDF file created from fdf_forge.

I couldn't get the field names from pdftk dump_data_fields because it wouldn't open the file without the correct owner password. I was able to remove the password from the file with a third-party program and create a file without password, so I got the fields from that. However, while the program I used to remove the password kept the fields in the file, it did something strange and made them bordered with a thick black border. So I don't want to write my FDF data to the cracked PDF, I want to add my data to the original secured PDF, just as if I opened and added the data by hand. However, I can't merge the FDF data into the secured PDF file because I don't know the password.

Any suggestions on how to programatically open a secured PDF file without knowing the password, and enter the data into the fields specified using Python, an FDF, and a call to pdftk from within a Python shell?

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
Furbeenator
  • 8,106
  • 4
  • 46
  • 54
  • "I was able to remove the password from the file with a third-party program and create a file without password" — Might want to look into how exactly this was done. If the program could crack the file, it must have gotten the password. – Fredrick Brennan Feb 21 '13 at 19:59
  • I'm not sure they got the password, I assume they just remove it from being required, but I could be wrong. – Furbeenator Feb 21 '13 at 20:00

0 Answers0