Here is a list of Open Source PDF Librarie that you can use:
PDFjet example
PDF pdf = new PDF(); Font f1 = new Font(pdf, "Helvetica"); Image image1 = new Image(pdf, "images/eu-map.png"); Image image2 = new Image(pdf, "images/fruit.jpg"); Image image3 = new Image(pdf, "images/mt-map.gif");
SharpPDF Example
pdfDocument myDoc = new pdfDocument("TUTORIAL","ME"); pdfPage myPage = myDoc.addPage(); myPage.addText("Hello World!",200,450,predefinedFont.csHelvetica,20); myDoc.createPDF(@"c:\test.pdf"); myPage = null; myDoc = null;
Report.NET Example
Report report = new Report(new PdfFormatter()); FontDef fd = new FontDef(report, "Helvetica"); FontProp fp = new FontPropMM(fd, 25); Page page = new Page(report); page.AddCenteredMM(80, new RepString(fp, "Hello World!")); RT.ViewPDF(report, "HelloWorld.pdf");
ITextSharp Example
Document document=new Document(); PdfWriter.getInstance(document,new FileOutputStream("hello.pdf")); document.open(); document.add(new Paragraph("Hello Pdf")); document.close();
Return on the fly created PDF files
You can return binary data using Response.Write see MSDN on "How to write binary data"
Here is an example of how you use Response.WriteFile to provide a PDF to the user:
source share