0

I want to sava a JFrame form into a PDF file. How can i do it?

For example my JFame form that is Invoice receipt consists of Jlabel JTextfield and Jbutton and i want to save it into pdf file how to make it by clicking a button?

Do I need to use "Itext"? Sorry, i am java beginner.Please help. Thanks in advanced.

All i can see is How to print content of a label in java?

Please refer to my Jframe JFrame Invoice save into pdf file

Community
  • 1
  • 1
JavaNew
  • 11
  • 5
  • 1
    You could capture a PNG image using this example: [Obtain image of JFrame](http://stackoverflow.com/questions/5853879/swing-obtain-image-of-jframe) then write that image to a PDF. – Clark Kent Dec 04 '15 at 14:53
  • Is there any other way instead of capture a image ? – JavaNew Dec 04 '15 at 15:00
  • did you check something around graphics? – Channa Jayamuni Dec 04 '15 at 15:12
  • sorry @ChannaJayamuni i dont get what u mean.. – JavaNew Dec 04 '15 at 15:15
  • @JavaNew Is the PDF blank or new? Does the PDF already exist with blank fields, and you're trying to translate the existing data from the JComponent fields into the PDF? I'm having a hard time understanding what the finished result should look like. – Clark Kent Dec 04 '15 at 16:57
  • what I want to do is 1) I will create a new template pdf and import into netbeans. I will just need to add the existing data from the JFrame form to the template. 2) I just save the JFrame form into PDF. Thats mean whatever i see in the Invoice JFrame form i want to save it into pdf file. Any one of the method above will do. – JavaNew Dec 05 '15 at 04:17

0 Answers0