iTextSharp lets you do some fancy things with table cells that can make your generated PDF documents look exactly the way you want them to. In this example I will expand on a previous article: iTextSharp: PdfPTable Basic Example . Specifically, I will show how to absolutely size your PDF table, how to right and center align Phrase objects in your table cells, and how to horizontally and vertically align text in rotated cells. Continue reading “iTextSharp PdfPCell Text Alignment Example”
When working with the iTextSharp PDF generation libraries for C#, you can use the XMLWorkerHelper object to export a Web page to PDF format. However while doing so you will run into the question of how best to serve the PDF up to your users.
Bottom line here is that you have two ways of doing so:
- You can stream the PDF document directly to the client browser
- You can create the PDF on the Web Server’s hard-drive and then redirect the client browser to the file
Each method has its pros and cons which you will have to weigh when deciding which technique to use.
At the end of this article I will give the example code in C# of how to generate a PDF using each of these two techniques.
Feel free to read some other articles I have written about using the iTextSharp PDF generation libraries with your .NET code.
Continue reading “C# iTextSharp Stream or Save Content using XMLWorkerHelper”
In this article I will give fully functioning examples in C# and VB.NET of using the iTextSharp Pdf library of objects to create a simple tabular report. Below I’ve added an image of what the report will look like.