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 6540387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:58:21+00:00 2026-05-25T10:58:21+00:00

I have a pdf with a form in it. I am trying to write

  • 0

I have a pdf with a form in it. I am trying to write a class that will take data from my database and automatically populate the fields in the form.

I have already tried ITextSharp and their pricing is out of my budget, even though it works perfectly fine with my pdf. I need a free pdf parser that will let me import the pdf, set the data, and save the PDF out, preferably to a stream so that I can return a Stream object from my class rather than saving the pdf to the server.

I found this pdf reader and it doesn’t work. Null reference errors are abundant and when I tried to “fix” them, it still couldn’t find my fields.

So, I have moved on to PdfBox, as the documentation says it can manipulate a PDF, however, I cannot find any examples. Here is the code I have so far.

var document = PDDocument.load(inputPdf);

var catalog = document.getDocumentCatalog();

var form = catalog.getAcroForm();

form.getField("MY_FIELD").setValue("Test Value");

document.save("some location on my hard drive");
document.close();

The problem is that catalog.getAcroForm() is returning a null, so I can’t access the fields. Does anyone know how I can use PdfBox to alter the field values and save the thing back out?

EDIT:

I did find this example, which is pretty much what I am doing. It’s just that my acroform is null in pdfbox. I know there is one there because itextsharp can pull it out just fine.

  • 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-25T10:58:22+00:00Added an answer on May 25, 2026 at 10:58 am

    Have you tried with the 1.2.1 version?

    http://pdfbox.apache.org/apidocs/overview-summary.html

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

Sidebar

Related Questions

I am using iText to populate a pdf form using data from our database.
I have an id that i am trying to read from my database and
I have a PDF form that has 450 fields in it and I'm going
I have an app that generates invoices in the form of PDF files stored
I have a PDF file, which contains data that we need to import into
I have a PDF that is being generated from HTML source using HTMLDOC. While
Find the field names of inputtable form fields in a PDF document? I have
I am trying to upload a file from a php form. I have verified
I'm trying to make a dynamic PDF form using Adobe LiveCycle designer and have
I am trying to fill a livecycle created form with form data from django.

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.