Posts

Showing posts from October 5, 2010

convert Object Array to String in java examples

How to convert Object Array to String in java examples public static String arrayToString(Object[] a, String separator) {     String result = "";     if (a.length > 0) {         result = a[0].toString();    // start with the first element         for (int i=1; i             result = result + separator + a[i];         }     }     return result; }

write pdf file using java with itext

Make a pdf file through itext jar in java write pdf file using java with itext import com.itextpdf.text.Document; import com.itextpdf.text.PageSize; import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfWriter; import java.io.FileOutputStream; /**   * @Manoj Shakya  */ public class Test {     public static void main(String [] aa){         try{         Document document = new Document(PageSize.A4, 10, 10, 10, 10);         PdfWriter.getInstance(document, new FileOutputStream("C:\\test.pdf"));         document.open();         PdfPTable bodytable = new PdfPTable(6);                 for(int i=0; i<5; i++){             bodytable...

Recent Post

Recent Posts Widget