pdf generation - How to display a Java List<> in PDF document using itext 5.3.0? -


{   list<integer> list=new arraylist<integer>();   list.add(10);   list.add(20);   com.itextpdf.text.list = new com.itextpdf.text.list(list);document.add(a); } 

it showing error argument in list match parameter.

there no constructor in class takes java.util.list parameter. please refer javadoc.

you may want work itext's list directly:

com.itextpdf.text.list = new com.itextpdf.text.list(); a.add("10"); a.add("20"); 

if working existing java.util.list have iterate on items add them:

com.itextpdf.txt.list = new com.itextpdf.text.list(); list<integer> integerslist = getlistfromdb(); for(integer item : integerslist) {     a.add(item.tostring()); } 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

qt - How to embed QML toolbar and menubar into QMainWindow -