Java Programing laungage

iText Projects

iText Project 1

Set Rectangular Page
Previous Home Next

By the help of this program we can create the rectangular page in the PDF file for creating rectangular page we firstly create the PDF file by utilizing the two package, which is help to create the PDF file and manipulation in it.

These package are

  • com.lowagie.text.pdf.*; and
  • com.lowagie.text.*;

For doing this, firstly import the some package. Before this we are going to add the iText jar file in our project. Then we can start the code.


package r4r;
import java.awt.*;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;

public class setrectangle
public static void main(String[] arg)throws Exception
Document doc=new Document(PageSize.A4,0,0,10,10);
PdfWriter.getInstance(doc,new FileOutputStream(
doc.add(new Paragraph(
	"This is the R4R free tutorials site"));

Previous Home Next