Itext Hello World

Source: Internet
Author: User

Itext 5.1.0 Java: http://sourceforge.net/projects/itext/files/

import java.io.FileOutputStream;
import java.io.IOException;
 
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
 
public class HelloWorld {
 
    public static void main(String args[]) throws DocumentException, IOException{
Document document = new document (); // create a document
Using writer. getinstance (document, new fileoutputstream ("helloworldworkflow"); // create an external writer object
Document. open (); // Open Document
Document. Add (new paragraph ("Hello world! "); // Add a paragraph
Document. Close (); // close document
    }
}
 

After compilation and running, the generated helloworldworkflow is generated in the folder where the project is located.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.