Hi
I have a web projet which has to have the functionality to create PDF.
Im using (trying...) the itextsharp library.
The data source is an ajax control, htmleditor from the ajax control toolkit by codeplex. This control gives me a xhtml string, this is the string that I use in the itextsharp. The problem is that I don't get a PDF with all the effects used on the editor (like typography, background color, etc.) Also when I use a bigger size in the text, sometimes it overwrites on other sentence.
Thank you for your time and help.
My apologies, a long time without writing in english.
Public Sub PDFCreation()
Dim Document As Document = New Document()
Dim ms As MemoryStream = New MemoryStream()
Dim writer As PdfWriter = PdfWriter.GetInstance(Document, ms)
Dim se As StringReader = New StringReader(Editor1.Content)
Dim obj As HTMLWorker = New HTMLWorker(Document)
Document.Open()
obj.Parse(se)
Document.Close()
Response.Clear()
Response.AddHeader("content-disposition","attachment; filename=report.pdf"
Response.ContentType = "application/pdf"
Response.Buffer = True
Response.OutputStream.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length)
Response.OutputStream.Flush()
Response.End()
End Sub