0

How can I make something like the pic below with Java. What I want is how to create a table and text with my own defined location? And how to calculate it to fit the A4 paper? The program will read input like "text1 text2 text3..." and it will put every single word to the table. Then it will has an option to print it as a A4.

enter image description here

Filburt
  • 17,626
  • 12
  • 64
  • 115
vnkid
  • 308
  • 2
  • 11
  • Would generating Excel files containing your data be a good fit to your need ? – Dici Sep 03 '14 at 21:15
  • Basically, Java assumes hat all printing is done at 72dpi, even when the printer is capable of higher resolution, all the calculations are done at 72dpi, which makes life very simple. Basically, what you want to do is is create a BufferedImage whose size is an a4 sheet at 72dpi and then print the contents to this buffered image. For [example](http://stackoverflow.com/questions/22058738/print-jlabels-icon-in-a-printer-using-a-button/22059079#22059079) – MadProgrammer Sep 03 '14 at 21:20
  • [This example](http://stackoverflow.com/questions/18460008/printable-prints-bufferedimage-with-incorrect-size/18466550#18466550) has some nice functions for converting pixels to dpi and visa versa – MadProgrammer Sep 03 '14 at 21:25
  • [Another example dealing with converstions](http://stackoverflow.com/questions/18975595/how-to-design-an-image-in-java-to-be-printed-on-a-300-dpi-printer/18975822#18975822) – MadProgrammer Sep 03 '14 at 21:28
  • But basically you are asking us to recommend or find a book, tool, software library, tutorial or other off-site resource, right? – Alexandre Santos Sep 03 '14 at 21:29
  • [And another purview example](http://stackoverflow.com/questions/14450012/using-printerjob-to-print-an-image-graphics2d/14450329#14450329) – MadProgrammer Sep 03 '14 at 21:31

0 Answers0