Click here to Skip to main content
15,895,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
try
	 {
		 BufferedReader  br = new BufferedReader(new FileReader(fname));
		 no=br.readLine();
		 String[] num=no.split(",");
		 int n=num.length;
		 PdfPTable table = new PdfPTable(n);
		 table.setWidthPercentage(100);

		 BufferedReader  br1 = new BufferedReader(new FileReader(fname));
		 while ((line = br1.readLine()) != null)
		 {
			
			String line1=line;
			 String[] parts = line1.split(",");
			 for(int i=0;i<parts.length;i++)>
			 {
			  part2 = parts[i]; 
			  PdfPCell cell1 = new PdfPCell(new Paragraph(part2));
			 
			
			  
			  table.addCell(cell1);
			 }
			 
			 addEmptyLine(preface1, 1);
			
		 }
		

		 document.add(table); 
	 }
	 catch(IOException e)
	 {
		  e.printStackTrace();   

	 }
Posted
Updated 3-Sep-14 0:15am
v3

1 solution

You can do that by modifiying the font:

Java
Font f1 = FontFactory.getFont(FontFactory.TIMES_ROMAN, 12);
f1.setColor(BaseColor.BLUE);
cell.addfont(f1); 


Please check where to apply the font so that the right amount of text is changed.
Also it might be needed to change back to black font afterwards (if not all elements of a certain layer are supposed to change).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900