Automatically create standards compliant PDFs from databases. Leading PDF library company iText Software is proud to announce the official launch of. Create/Read/Write Advance PDF Report using iTextSharp. Recently I was looking for an Advance Tool to create complex PDF Report in C#. How to Convert an HTML. Basic PDF Creation Using i. Text. Sharp. This is the first of three articles about creating PDF documents using i. Text. Sharp. The Namespace is really big, so I will focus on the parts you'll probably use when you need to create PDFs on a daily basis. There are tons of articles out there but they often just show a specific task, so I thought I might do one simple step by step, starting off with the basics. In this article series I use a web application to show how easily you can create a valid PDF document with just a few lines of code, using the tool i. Text. Sharp which is a free . NET component downloadable at http: //sourceforge. After we have downloaded and unzipped the i. Text. Sharp dll and created our project we need to add a reference to i. Text. Sharp. dll. ITextSharp, a.NET PDF library download. 2012/04/converting-html-to-pdf-using-itextsharp.html Using. Create a PDF document file in C#. 31 Responses to Using C# and iTextSharp to create a PDF. Do that by right clicking the Reference folder in your solution. Select the file by browsing to the save directory and selecting the file i. Text. Sharp. dll. To make the use of the component simple in code, add the following using statements in your code. Text. Sharp; using i. Text. Sharp. text; using i. Text. Sharp. text. Let's also create a folder where we save our PDF's; right click the solution and add a folder, name it . Okay, we are now all set to create our first PDF document. Our first document. First we create a file stream object representing the actual file and name it to whatever you want.(By using the method Map. Path we target the folder we created earlier as this is a Web application) System. IO. File. Stream fs = new. File. Stream(Server. Map. Path(. Then use that object and the file stream to create the Pdf. Writer instance enabling us to output text and other elements to the PDF file.// Create an instance of the document class which represents the PDF document itself. Document document = new. Document(Page. Size. A4, 2. 5, 2. 5, 3. Create an instance to the PDF file by creating an instance of the PDF // Writer class using the document and the filestrem in the constructor. Pdf. Writer writer = Pdf. Writer. Get. Instance(document, fs); A good thing is always to add meta information to files, this does it easier to index the file in a proper way. You can easilly add meta information by using these methods. The properties we added are found in the document by choosing File - Properties in the open PDF document: Well, I have a Swedish version of Acrobat Reader as you all can see, I mean; as you all CAN'T see (!), but the fields are self explained. Please, check out Part II describing how to write text, place images and some simple graphics in the PDF document. Part II, Part III.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |