Java code to create AFP file

1.5k Views Asked by At

I wanted to create AFP file using Java.The file contains images, dynamic data like username , coloured texts and pictures. Just wanted to create electricity light bill.

2

There are 2 best solutions below

0
vikas j On

In my opinion, There are two ways to create AFP files using java.

  1. Using XSLT and FOP, In this you have to use xslt style sheeting over xml data and then apply FOP over it.FOP provide multiple options to create multiple docs. like pdf,afp etc refer this-> [https://xmlgraphics.apache.org/fop/0.95/output.html][1]

  2. Using Japer report.

0
Saurabh Sonkar On

Using jasper you need to create the jasper report then populate it using JavaBean or data source.Then use that compiled jasper file to the Afp printer driver of IBM which converts the file to the AFP file.