Java Programing laungage

iText Projects

iText Project 1

adplus-dvertising
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

  • java.io.*;
  • 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.

Example

package r4r;
import java.io.*;
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(
	"setrectangle.pdf"));
doc.open();
doc.add(new Paragraph(
	"This is the R4R free tutorials site"));
doc.close();
}
}

Previous Home Next