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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:23:24+00:00 2026-06-14T05:23:24+00:00

Is is possible to add validation to PDF form fields via iTextSharp. I currently

  • 0

Is is possible to add validation to PDF form fields via iTextSharp.

I currently generate a PDF document, fill editable form fields with values from my database and present the document to the user in a webpage.

PdfReader pdfReader = new PdfReader(template);
PdfStamper pdfStamper = new PdfStamper(pdfReader, writeStream);
AcroFields pdfFormFields = pdfStamper.AcroFields;

pdfFormFields.SetField("field1", myobj.field1value);
...
pdfStamper.Close();

I’d like to be able to dynamically add validation e.g. numeric field min-max values, or custom JavaScript to the field in this document rendering process. I know this is possible when designing the form in Acrobat, but I can’t find any methods/fields for accessing these validation fields through iTextsharp.

  • 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-06-14T05:23:26+00:00Added an answer on June 14, 2026 at 5:23 am

    When looking for answers, please consult the documentation: “iText in Action”.

    Your question is answered by an example:

    • Java: http://itextpdf.com/examples/iia.php?id=238
    • C#: http://kuujinbo.info/iTextInAction2Ed/index.aspx?ch=Chapter13&ex=AddJavaScriptToForm

    In this example, some custom JavaScript including a validate() method is added to a field/button. This is the JavaScript: http://examples.itextpdf.com/resources/js/extra.js

    The JS added as Additional Action (AA) or as action to a Submit button is identical to the JS one would write for HTML.

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

Sidebar

Related Questions

I would like to kwnow if it possible for users to add validation rules
for example, I want to add this to jsfiddle.net jQuery Validation is this possible?
Is it possible to add the OR operator to php isset submit form code
i'll try and be as clear as possible. I'm working on some form validation
is it possible to add a JS validation function for CompareValidator? i can't use
I simply need to add a validation class that limits a numerical entry from
Is it possible to add a domain string to validation messages in CakePHP models?
Is it possible to programatically disable form validation in MVC2? I'm hoping there is
I want to add a validation in my model where I have 2 fields:
Is it possible in Magento to extend validation.js to add the ability to validate

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.