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

  • SEARCH
  • Home
  • 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 6530455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:45:26+00:00 2026-05-25T09:45:26+00:00

I have a PDF form that has 450 fields in it and I’m going

  • 0

I have a PDF form that has 450 fields in it and I’m going to fill it out using data that is in my Database. Each field in the PDF has a unique name and I can do a mapping like:

switch (fieldname)
{
    case "Name":
        value = GetData(Name);
        break;  // Etc...
    case "Date":
        value = Date();
        break;
    default:
        value = "";
        break;
}

Now it seems like this is going to get very complex fast having 450 branches and if other documents get added it could grow massively. What are the potential patterns that are available to solve this kind of problem? Essentially I want to bind the PDF fields to the Database fields.

* EDIT *
So lets just say that I have a giant switch statement ~450 branches, that routes PDF field names like ‘Name’ ‘Address’ ‘Phone’ to the correct database query for execution. What other ways can I solve this other than switching on the field names when the field names are variable depending on which document was selected by the end user.

* FINAL EDIT *
I thought about it for a day and came up with solution thanks to all the suggestions. I have a function called GetElement(). It takes the PDF field name as a parameter and executes a stored procedure that returns the database column and another procedure name as a map. Then using some dynamic SQL I pass the procedure name and column i’m looking for and return the results. Hard to pick the right answer here but I’ll give credit to the one that pushed me the closest.

  • 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-25T09:45:27+00:00Added an answer on May 25, 2026 at 9:45 am

    From what little I know about your overall problem, it seems it would be easiest to store the field name along with the value in the DB. It’s a simple name-value pair looping structure then, and you don’t hard code name strings in your code that way either. More generic? Hope this helps.

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

Sidebar

Related Questions

I have a pdf document that has form fields that I'm filling out programatically
i have a form that users can fill out and i need the users
I have a savable PDF file that has a bunch of fields that users
I have an app that has a rather large help section in PDF form.
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
I have a process that creates form data in the form of an .fdf
I have a PDF document that represents a print form that is normally filled
I have ten fields in my table in database..And two columns out of them

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.