Wednesday, November 19, 2014

Step by Step guide to create First PDF report with ADOBE Pro and iTextSharp -- .NET

Recently I had to work on a reporting module for Mobile application. I used iTextSharp to write wrapper class which was responsible for creating PDF files on the fly. The plan was to create PDF forms from Adbobe Acrobat Pro and generate PDF reports using the iTextSharp and my wraper class. My wrapper class takes PDF Template path, Simple Modal object (Just having values to print on PDF) and the output PDF path as input and generate PDF report. Let us see in more detail.

First Install NuGet Package, iTextSharp

Create PDF form 

First create a mock up of a report in the word document,


Reflection: Dynamically reading Object Properties and Calling Methods -- .NET


Introduction

In the .NET Framework, every program is compiled into an assembly containing metadata which has information of assembly behavior and structure. Reflection in .NET is used to observe and change the behavior of any object which means you can read read metadata of an object through reflection.

Current sample is going to describe following features of Reflection,
  1. Object properties and their datatypes.
  2. Call object methods dynamically. 
The first thing to use reflection in your project is, include the reflection namespace,

using System.Reflection;