Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4247836
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:09:53+00:00 2026-05-21T04:09:53+00:00

I have a PDF file (not created by me – I have no control

  • 0

I have a PDF file (not created by me – I have no control over the design etc.) which allows users to fill in some form fields in Adobe Reader and save the result. I want to automate the process of populating the fields, using the following steps:

  1. Fetch data from database.
  2. Open PDF template.
  3. Populate form fields with data.
  4. Save modified file to a separate location on disk.
  5. Lock modified file so that the form fields can no longer be edited.
  6. Send file to user.

I’m happy to use PHP, Perl, Python or Java to do steps 2-5 (in descending order of preference), but whatever I use has to work under Linux (i.e. it mustn’t rely on libraries which are only available on Windows for example).

The end result should be a PDF which the average user can open and print, but not modify (I’m sure advanced users could find a way to do so, but I accept that I can’t guarantee complete security against modification). I don’t want to change the structure of the PDF, merely populate the form fields.

Is there a standard piece of software for doing this? I’ve seen mentions of FDF Toolkit, but I’m not entirely sure if that’s what I want and whether it will allow me to lock the file afterwards, and whether what I want to do fits in with the EULA.

Edit: Final answer is to use iText (as suggested by Mark Storer) but to implement it as a web service which allows you to pass in an array of form field names and values and the PDF file ‘template’. The web service will be open source (and available on GitHub once I’ve written it), as per the AGPL, but anything connecting to it won’t have to be.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:09:54+00:00Added an answer on May 21, 2026 at 4:09 am

    Filling

    Any number of different libraries can fill in field values. I’m partial to iText (java) or iTextSharp (c#). I wrote one in Java a number of years ago. It’s not that hard). There are lots. Search SO, you’ll find ’em.

    Locking

    There are a couple different levels of "lock the fields".

    • Each field has a "read only" flag. This is pretty much a courtesy as far as other libraries capable of setting field values are concerned. In fact, it’s generally considered to mean "the ui cannot make changes". Form script can, regardless.
    • Form flattening: Draw the fields directly into the page and removing all the interactivity.

    Each one has pros and cons.

    Flag: None too secure. Form data still easily accessible. Scrolling fields still scroll.
    Flattening: Pretty much the exact opposite. It’s harder to modify (though far from impossile). The form data can only be extracted via text extraction (which is hard, but becoming increasingly common). List & text fields that contain more stuff than is visible will no longer scroll.

    The ability to flatten forms is relatively rare. Again, iText can do it (as can iTextSharp), but I’m not aware of any other third party libraries that can… I’m sure they exist, I just can’t name them off the top of my head.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PDF file, which contains data that we need to import into
I have a row of buttons, which all create a pdf file which I
I have a pdf file.I need to find all the hyperlinks available in that
I have this: Dim myTemp As String myTemp = System.DateTime.Now().ToString(MMMddyyyy_HHmmss) & .pdf System.IO.File.Copy(myFile, c:\
I have several A4 PDF documents which I would like (two into one) glue
So, I have a .pdf file and I need to be able to determine
I have 3 PDF documents that are generated on the fly by a legacy
I have a PDF document that needs to be pulled up in the browser,
I have a PDF that is being generated from HTML source using HTMLDOC. While
I have around 1000 pdf filesand I need to convert them to 300 dpi

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.