954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Create pdf file from c#

how to create pdf file from c#

tbanisida
Newbie Poster
7 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
 

By using library like iTextSharp

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 
Mahadesh
Newbie Poster
1 post since Jun 2011
Reputation Points: 10
Solved Threads: 0
 
how to create pdf file from c#

Creating PDFs from scratch can involve a lot of effort. You'll almost certainly find the easiest solution is to use a third-party PDF component, of which there are many available on the market today.

For the .NET Framework, ABCpdf , iTextsharp and PDFSharp should do the trick. All available for free*. Each component has strengths and weaknesses, so finding the best one for a particular task requires a little research.

You'll find each component offers a unique set of basic drawing commands. These enable you to construct valid PDF documents. They may also provide additional drawing methods for laying out documents, such as System.Drawing, PostScript, HTML & CSS, etc.

The following C# code shows how simple creating a PDF document can be...

Doc theDoc = new Doc();
theDoc.FontSize = 96;
theDoc.AddText("Hello World");
theDoc.Save("simple.pdf");
theDoc.Clear();


* ABCpdf is a commercial component. A single license for the standard edition is obtainable for free.

* iTextsharp version 4 is free. Newer versions are free for non-commercial use.

AffineMesh94464
Newbie Poster
8 posts since Mar 2010
Reputation Points: 10
Solved Threads: 2
 
how to create pdf file from c#


You should provide the question in more detail. If your requirement is only to save some record in pdf format there is built in methods to save a document as pdf files.

k.d.m
Light Poster
35 posts since May 2009
Reputation Points: 11
Solved Threads: 8
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: