Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Skewing Text    

                         

In this section, you will learn how to make a program by which you can set skew in for chunk. iText api provides a method setSkew(float value1,float value2).This method is used in palce of italic font.   

Code Description:
We can use the method setSkew(float alpha,float beta) in place of italic fonts (if we are using a font that doesn,t  support  Font.ITALIC). We take 0f as alfa and 12f as value for beta.Alfa is the angle of the baseline in degrees. In the example, we rotate some text 45f and -45f degrees. Beta is the square-angle on the baseline.

The code of the program is given below:

import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;
public class exampleOfSkew {
  public static void main(String[] args)throws Exception
                {
    System.out.println("Example of Skew");
    Document document = new Document();
      PdfWriter.getInstance(document,new FileOutputStream("Skew.pdf"));
      document.open();
      Paragraph p = new Paragraph("Rose India.net");
      document.add(p);
      Chunk chunk = new Chunk("Rose India.net");
      chunk.setSkew(45f0f);
      document.add(chunk);
      document.add(Chunk.NEWLINE);
      chunk.setSkew(0f45f);
      document.add(chunk);
      document.add(Chunk.NEWLINE);
      chunk.setSkew(-45f0f);
      document.add(chunk);
      document.add(Chunk.NEWLINE);
      chunk.setSkew(0f, -45f);
      document.add(chunk);
      document.add(Chunk.NEWLINE);
      chunk.setSkew(16f35f);
      document.add(chunk);
      document.add(Chunk.NEWLINE);
      Chunk italic = new Chunk("This looks like Font.ITALIC");
      italic.setSkew(0f15f);
      document.add(italic);      
    document.close();
  }
}

The output of the program is given below:

Download this example.

 

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Latest Searches:
java codes for multipl
keyevents
Class Variables
notify
define
how to set vertical sc
PHP Date and time func
jsp action tags
create text file using
methods return type
passing values from js
Message Driven Bean Tu
Writing Java Object (P
readLine
Java code for media pl
how to use <iterate> i
session get data fro
pthread.h
create table in struts
generic
tree
text editor
type Conversion of Str
Photoshop Cheese Tutor
cookie
ะ�ะ�ะ�?�
Java Tuthreadstorials
PHP Searching Building
SQL in Privilleages
excel from java
navigate to other page
wrapper calss
multiple radio buttons
Create two JComboBox C
triggers in sql
xml dom4j
JSF richfaces for tree
jsp code to manipulate
get character array in
PHP Miscellaneous Crea
Tomcat deploy JSP
Photoshop tutorial : A
sample palindrome prog
Calendar class
get column count
java client/server
rc4
array list
get Numeric Value
check character
compress file uploadin
add a list box in a fo
difference between arc
sequence number
definition of interfac
ASP.NET .NET Security
creation of a director
MIME TYPE
jsp include
how to read and wirte
jboss portal lusene
delete
)How
random walk generator
simple calendar
dynamic table
pim api
storing text data to a
emailing file using js
format output
reading file(java)
Convert String to Bool
decimal to ANSI
jstl list size
ASP.NET .NET File Uplo
call ???????????°????
Eclipse 3.4 EJB
servermail service pro
text box in swing
display image from dat
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.