Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PdfPTable table = new PdfPTable(6);
- table.setWidthPercentage(100);
- PdfPCell cell;
- cell = new PdfPCell (new Phrase ("prenom" ,FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- cell = new PdfPCell (new Phrase ("nom" ,FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- cell = new PdfPCell (new Phrase ("email" ,FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- cell = new PdfPCell (new Phrase ("age" ,FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- cell = new PdfPCell (new Phrase ("codepostal" ,FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- cell = new PdfPCell (new Phrase ("adresse" ,FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- cell = new PdfPCell (new Phrase (pfield.getText().toString(),FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- cell = new PdfPCell (new Phrase (nfield.getText().toString(),FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- cell = new PdfPCell (new Phrase (emailfield.getText().toString(),FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- cell = new PdfPCell (new Phrase (agefield.getText().toString() ,FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- cell = new PdfPCell (new Phrase (cpfield.getText().toString(),FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- cell = new PdfPCell (new Phrase (adrfield.getText().toString(),FontFactory.getFont("Cosmic Sans Ms",12)));
- cell.setHorizontalAlignement(Element.ALIGN_CENTER);
- cell.setBackgroundColor(BaseColor .GRAY);
- table.addcell(cell);
- doc.add(table);
- doc.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement