More efficient code for making an iTextSharp template in ASP.NET MVC?

Asked

Viewed 230 times

0

I only did a project to generate PDF’s using the iTextSharp library in ASP.NET MVC (C#), however I would like to know which code is most efficient and easy to use to have a template that generates PDF using iTextSharp in ASP.NET MVC (C#), what code to include in the Controller/Model/View? I needed to be able to insert in this PDF header and footer always the same (logos/name/address/date) and in the body of the PDF images and/or text! What code to put in the Controller/Model/View?

  • What in your opinion would be easier to use?

  • The one that would have fewer lines of code and less memory usage!

1 answer

0

The most efficient code includes using a library of my own. Works with all versions of iTextSharp, including version 4, which is built into the project. The general idea is to transform a View Razor in PDF.

Here are examples of use.

If you only want to use iTextSharp from version 5 onwards, you can directly use the Mvcrazortopdf.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.