Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Editing a PDF file with Java

I'm trying to edit a existing PDF file. It is a file where I need to fill in some addresses and other stuff. I want to connect an addressbook to the application so the user can select a user from the addressbook and a part get filled in automatic.

My questions are:

  1. Is it possible to edit a existing PDF file and fill in some fields (+/- 20), because I know there is Itext (http://www.itextpdf.com) but I read that the possiblities are very small.
  2. Or can I better convert the PDF to JPG and get it as background. And create JLabels on the places where I need to fill in the fields. And then print the whole Frame on a A4.
  3. Or are there better posibilities?

So what I need to do, step by step:

  • Select one of the PDF's (they are in the program)
  • Fill some fields with content/addresses
  • Print the PDF/Form with a printer
like image 529
Danny Gloudemans Avatar asked Jul 28 '26 01:07

Danny Gloudemans


1 Answers

There is a toolkit given by Adobe named as Acrobat Forms Data Format (FDF) Toolkit which gives API for different languages to fill forms.

You can get the java code at the bottom of that page or check this link

like image 71
AurA Avatar answered Jul 29 '26 16:07

AurA



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!