Then the width of the table is set in points, and fixed. The width of the columns themselves are set relatively at one third and two thirds of the total table width. To set it a one fifth and 4 fifths, you would pass in 1f and 4f respectively. This is useful if you have more than one table following on from another, as the default behaviour is to pin subsequent tables to the previous one, as in MS Word, where a quick tap of the Enter key has the same spacing effect. The border is removed from the first cell, which is treated as a header by setting the colspan to equal the number of columns in the table, and the text in the cell is centre-aligned, using the same value as that used for aligning the table in the document.
|Published (Last):||27 September 2017|
|PDF File Size:||11.8 Mb|
|ePub File Size:||9.20 Mb|
|Price:||Free* [*Free Regsitration Required]|
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 iTextSharp which is a free.
Version 5. After we have downloaded and unzipped the iTextSharp dll and created our project we need to add a reference to iTextSharp. Do that by right clicking the Reference folder in your solution. Select the file by browsing to the save directory and selecting the file iTextSharp. To make the use of the component simple in code, add the following using statements in your code.
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 MapPath we target the folder we created earlier as this is a Web application System. Create To create a PDF document, create an instance of the class Document and pass the page size and the page margins to the constructor. Then use that object and the file stream to create the PdfWriter instance enabling us to output text and other elements to the PDF file.
Basic PDF Creation Using iTextSharp - Part I
Subscribe to RSS
Itextsharp In C#