XMLWorkerHelper.GetInstance().ParseXHtml(writer, PdfFile, reader) Phrase1.Add(new Chunk(html, FontFactory.GetFont("Arial", 14, Font.BOLD))) Ĭell = PhraseCell(phrase1, PdfPCell.ALIGN_CENTER) Ĭell.VerticalAlignment = PdfPCell.ALIGN_MIDDLE Table.HorizontalAlignment = Element.ALIGN_LEFT Var titleFont = FontFactory.GetFont("Arial", 16, ) PdfWriter writer = PdfWriter.GetInstance(PdfFile, stream) StringReader reader = new StringReader(ExportData) ĭocument PdfFile = new (PageSize.A3) Using (MemoryStream stream = new System.IO.MemoryStream()) String ExportData = "This is first pdf generat" Private static PdfPCell PhraseCell(Phrase phrase, int align)Ĭell.VerticalAlignment = Element.ALIGN_TOP Install the in your project itextsharp.xmlworkerĪdd reference and code on your controller using System.IO Basically all I want is to be able to generate PDFs directly from the application. I am open to any suggestions if there any. Window.open('./Account/GeneratePdf?html=' + html, '_blank') Return File(pdf,"application/pdf","Financial Report.pdf") īelow is the javascript code within the view PdfDocument oPdfDocument = oHtmlToPdf.ConvertHtmlString(html) Here is the code within the controller public ActionResult GeneratePdf( string html) ![]() When clicked the PDF is generated the problem is that it is blank with no content in it. ![]() In my view I have a button that is used to generate the PDF. I want to generate PDFs directly from the application. I am doing my final year project and the concept of C# MVC is still new to me.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |