I send the contents of Telerik MVC Editor to the controller using Ajax as a string: I exit as:
"<strong>Hello world!</strong> <object height=\"1\" id=\"plugin0\" style=\"position:absolute;z-index:1000;\" type=\"application/x-dgnria\" width=\"1\"><param name=\"tabId\" value=\"{84594B7B-865F-4AD7-A798-294A8B0EB376}\" /></object>"
In the controller, I save the string in a session variable using the following:
string comments = HttpUtility.HtmlDecode(Text); MySession.Current.pdfText = comments;
I can convert it to pdf using
..... HTMLWorker parser = new HTMLWorker(document); .......
However, I could not add any other paragraphs to the same page, this makes a new page.
I tried using the following to create a new paragraph using HTMLWORK:
string PDFText = MySession.Current.pdfText; string PDFText1 = HTMLWorker.Parse(PDFText); StringReader reader = new StringReader(PDFText1); paragraph.Add(reader);
I got the following errors:
cannot convert from 'System.IO.StringReader' to 'string', and The best overloaded method match for 'iTextSharp.text.html.simpleparser.HTMLWorker.Parse(System.IO.TextReader)' has some invalid arguments, and The best overloaded method match for 'iTextSharp.text.Phrase.Add(string)' has some invalid arguments
I would appreciate your suggestions, thanks in advance.
source share