Java Programing laungage

iText Projects

iText Project 1

adplus-dvertising
Skewing the Text
Previous Home Next

The iText jar file provide the facility of the Text skew. for performing this task the java iText jar file provide a method called setskew(float alpha,float beta).

Example:-

package r4r;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import com.lowagie.*;
import java.io.FileOutputStream;

public class skewtest {
public static void main(String[] args)throws Exception
{
System.out.println("Testing of Skew");
Document doc = new Document();
PdfWriter.getInstance(doc,new FileOutputStream("skewtest.pdf"));
doc.open();
Paragraph p = new Paragraph("R4R Techsoft solution");
doc.add(p);
Chunk chunk = new Chunk("R4R.co.in");
chunk.setSkew(45f, 0f);
doc.add(chunk);
doc.add(Chunk.NEWLINE);
chunk.setSkew(0f, 45f);
doc.add(chunk);
doc.add(Chunk.NEWLINE);
chunk.setSkew(-45f, 0f);
doc.add(chunk);
doc.add(Chunk.NEWLINE);

Chunk italic = new Chunk("Done");
italic.setSkew(0f, 15f);
doc.add(italic); 
doc.close();
}
}
 
Previous Home Next