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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:15:56+00:00 2026-05-27T03:15:56+00:00

I have an existing pdf that I am filling out dynamically in java. I

  • 0

I have an existing pdf that I am filling out dynamically in java. I have all the fields that require strings set up and working, but the fields that use int or date dont seem to work. Here is the relevant code:

        response.setHeader(contentDisposition, "attachment; filename=" + officialFile);    
        reader = new PdfReader(this.getServletContext().getResource("/pdf/" + officialFile));
        stamp = new PdfStamper(reader, response.getOutputStream());
        form = stamp.getAcroFields();
        // form.setField("date", currentDate);  //This is a date, and will give me an error
        form.setField("last_name", lName);
        form.setField("first_name", fName);
        form.setField("first_middle_last", fmlName);
        form.setField("status", studentStatus);
        // form.setField("HR's", hours); //This is an int, and will give me an error
        // form.setField("CENSUS DATE", censusDate);  //This is a date, and will give me an error
        form.setField("term", term);

        stamp.setFormFlattening(true);
        stamp.close();

So the parts that are commented out are where my int’s and dates are supposed to be written on the pdf. I was wondering if there was a way to write them to this pdf without converting them to strings, and if there is no way…..then what would be the best way to convert them? Thanks in advance.

  • 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-27T03:15:57+00:00Added an answer on May 27, 2026 at 3:15 am

    Convert them.

    Integer.toString(yourInt);
    

    For the Date use the SimpleDateFormatter according to your requirements.

    SimpleDateFormat sf = new SimpleDateFormat("dd.MM.yyyy");
    String formattedDate = sf.format(yourDate);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have existing java code and need to create Design Document based on that.
I'm working on a project where the client wants to have existing pages dynamically
I have an existing java webapp that uses Hibernate for it's persistence. I've been
I have existing code that uses CMNewProfileSearch to find then iterate over the color
For whatever reason, I have a lot of clients that have existing data that's
We have an existing WCF service that makes use of wsDualHttpBinding to enable callbacks
I have some code that generates a PDF file programmatically and I need to
I'm working on a project that aims to replace our current PDF generator with
I have an existing PDF and I can use FdFWriter to input to text
I want to generate PDF files or convert the existing PDF files that uses

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.