/***** Code de MesExemples.com *******/
/**
* @(#)NewDocPage.java
*
*
* @author
*sakoba(java.mesexemples.com) @version 1.00 2013/5/29
*/
import java.io.FileOutputStream;
import java.io.IOException;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
public class NewDocPage {
public static void main(String[] args) {
Document document = new Document();
try {
PdfWriter.getInstance(document,
new FileOutputStream("c:/NewDocPagePDF.pdf"));
document.open();
document.add(new Paragraph("Première Page."));
document.setPageSize(PageSize.A3);
document.newPage();
document.add(new Paragraph("Page format A3."));
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
document.close();
}
}
Java: Créer une nouvelle page dans un document PDF
Author: user/***** Code de MesExemples.com *******/
/**
* @(#)NewDocPage.java
*
*
* @author
*sakoba(java.mesexemples.com) @version 1.00 2013/5/29
*/
import java.io.FileOutputStream;
import java.io.IOException;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
public class NewDocPage {
public static void main(String[] args) {
Document document = new Document();
try {
PdfWriter.getInstance(document,
new FileOutputStream("c:/NewDocPagePDF.pdf"));
document.open();
document.add(new Paragraph("Première Page."));
document.setPageSize(PageSize.A3);
document.newPage();
document.add(new Paragraph("Page format A3."));
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
document.close();
}
}