views:

38

answers:

3

I'm developing a CMS aplication in ASP .Net using WebForms and I'm looking for a way to create new PDF files based on a template.

This feature will be used to generate contracts where some placeholders will be replaced with the customer data.

What's the best approach to do that?

Edited: The templates will be static, the main content will never change from customer to customer, only some text in the beginning that will contain the placeholders to recive the customer data. The catch is that I must allow the owner of the application to upload new templates in PDF, with the predetermined placeholders in it to allow the replacement to occur.

+1  A: 

I can think of two approaches depending on what type of template you are looking at:

1) Static Template - Say the template does not change with the data (Ex.some standard compliance form etc) You can try something like iTextSharp, where you have your templates defined in your .net code, and you just "plug in" the relevant data and render the PDF via iTextSharp.

2) Dynamic Templates - Say your template isn't standard and is user customizable. In this case, I'd say go for HTML for designing and "print" the for to PDF. There are many components available.

You may also want to try out components like crystal reports.

Srikanth Venugopalan