java - itext (Text - Pdf) center alignment -
i using itext generate pdf file. want align text in middle of page. input file looks in below format
we refer isda credit support annex dated of 1 oct 2009. below data.
portfolio mtm usd 24,479,059.69 independent amount usd 0.00 threshold usd 1,000,000.00 credit support amount / exposure usd 23,479,059.69 credit support balance usd 26,140,600.00 net margin requirement usd 2660940.31 minimum transfer amount usd 250,000.00 rounding amount usd 10,000.00 delivery amount usd 2670000
my java code below
fileinputstream fis = new fileinputstream(infile); datainputstream in = new datainputstream(fis); inputstreamreader isr=new inputstreamreader(in); bufferedreader br = new bufferedreader(isr); string strline; while ((strline = br.readline()) != null) { paragraph para =new paragraph(strline+"\n"); para.setalignment(element.align_justified); document.add(para); } document.close();
while trying generate pdf file alignment below data not working. please let me know whether above code correct. in advance.
try align_center instead
paragraph para = new paragraph(strline+"\n"); para.setalignment(element.align_center);
Comments
Post a Comment