Click here to Skip to main content
15,908,776 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Sample Code require for develop VB.Net project to Create PDF File useing itextsharp.dll how it work.
Posted
Comments

read the article, at codeproject
ITextSharp Helper Class[^]
 
Share this answer
 
Hai here is an example to create a pdf file using itextsharp.dll in vb.net
Dim doc As New Document(iTextSharp.text.PageSize.LETTER, 10, 10, 42, 35)
Dim writer As PdfWriter = PdfWriter.GetInstance(doc, New FileStream("D:\Temporary\sample.pdf", FileMode.Create))
doc.Open()


Dim para As New Paragraph("This is my first paragraph")
Dim pharse As New Phrase("This is my first phrase")
Dim chunk_ As New Chunk("This is my first chunk")

doc.Add(para)
doc.Add(pharse)
doc.Add(chunk_)

doc.Close()
 
Share this answer
 
Comments
Member 10486834 25-Dec-13 7:10am    
if there are different colored text then how to export these colored text to pdf.
it always display in the black color but what i want is how to create a pdf document which consists of different colors ?
here:

Printing with CodeDom Scripts[^]

you'll find a simple solution that I've published.
It is a library that you can use to interface a CODEDom script to ITextSharp to make PDF in a very simple way.
 
Share this answer
 
Comments
Maciej Los 13-Apr-18 16:01pm    
7 years too late...
giamp_72 13-Apr-18 16:07pm    
This post appears in Google searches, so I thought to share my recent post, answering at this one
SQL
if there are different colored text then how to export these colored text to pdf.
it always display in the black color but what i want is how to create a pdf document which consists of different colors ?
 
Share this answer
 
Comments
CHill60 25-Dec-13 8:31am    
If you have a question of your own use the "Ask a question" link. Posting a question as a solution to an old post not only attracts downvotes and reports, but fewer people will see it, therefore you are less likely to get help.
Member 10486834 25-Dec-13 14:22pm    
i am new to this portal , anyways i've asked a new question with "Ask a question" link
Learn simply to click http://mikesdotnetting.com/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900