/***** Code de MesExemples.com *******/ /** * @(#)ExempleSetSpacingAfter.java * * * @author *sakoba(java.mesexemples.com) @version 1.00 2013/5/29 */ import java.io.FileOutputStream; import com.itextpdf.text.Document; import com.itextpdf.text.PageSize; import com.itextpdf.text.Paragraph; import com.itextpdf.text.pdf.PdfPCell; import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfWriter; public class ExempleSetSpacingAfter { public static void main(String[] args) { Document document = new Document(PageSize.A4); try { PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("c:/ExempleSetSpacingAfter.pdf")); document.open(); PdfPTable table = new PdfPTable(3); PdfPCell cell = new PdfPCell(new Paragraph("entête")); cell.setColspan(3); table.addCell(cell); // Modifier la marge après la table table.setSpacingAfter(150f); document.add(table); document.add(table); document.add(table); } catch (Exception de) { de.printStackTrace(); } document.close(); } } |
Cet article Java PDF: Modifier l’espace d’après la table est apparu en premier sur .