This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

iText issue- how to read filled PDF from from a hashmap.

 
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am beginner to iText api. I have created an API to read PDF template ,prepopulate with some fields and display it back to user.
Users enters somedata and submits it back to db.

This part works fine but i have to implement another feature with iText.
When user fills PDF form and submits it back , there is one option on my UI to modify PDF form.
Which should open same PDF form filled with User data and user can change it.

I dont know how can i accomplish this with i Text.

I wont be read data back from DB As i have have one HashMap populated with user filled data but dont know how to make PDFRader reader from that form .
Fields have textboxes,checkboxes and some blocks which are 'crossed out' when selected.So i would want same behaviour from
'modify' option

Another option i can think .
Read blank template again using PDFReader and read Hashmap using Iterator and setValues based on that which is long lengthy code.




Any suggestions?
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the problem in keeping track of the data to be used, or in using that data to (re-)populate the PDF?
 
Lucky J Verma
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem is with radio buttons on my PDF form and some hidden fields tied to it with javascript in PDF(acro javascript) eg .

radio buttons - name "bo" choices are -> BO_TRUST, BO_CORP,BO_PART
if use selects any radio button, javascript sets the value of some hidden field to 1(one hidden field for each choice ) and it
gets value either 0 or 1
This hiddenfields (all of them) are columns are Db and persist.

To modify form, and prepopulate with user-entered values, how do i reverse code this.
Reading hidden fields (any has value 1) ,then radiobutton to that is selected.?How to find radiobutton in Text with choice.
 
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!