Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions > Programming Tips and FAQ » Create PDF Files on fly in C# - iText for C#.net
Closed Thread
Old 02-16-2007, 09:43 PM   #1 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,410

office politics will become famous soon enough

Default Create PDF Files on fly in C# - iText for C#.net

Create PDF Files on fly in C# - iText for C#.net
Author intexture

iText for C#.net
Reference - > itextsharp.sourceforge.net ; http://www.lowagie.com/iText/

Creation of PDF Document in 5 easy steps

Step 1: First create an instance of document object

Document myDocument= new Document(PageSize.A4.Rotate());


Step 2: Now create a writer that listens to this doucment and writes the document to desired Stream.

PdfWriter.GetInstance(myDocument, new FileStream("Salman.pdf", FileMode.Create));


Step 3: Open the document now using

myDocument.Open();

Step 4: Now add some contents to the document

myDocument.add( new Paragraph ( "First Pdf File made by Salman using iText"));

Step 5: Remember to close the documnet

myDocument.close();
office politics is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On