var paper = _repo.VeryLatestPaper().Result;
List list = new List(List.ORDERED);
paper.Questions.ForEach(q => list.Add(q.Message));
var doc1 = new Document();
string path = "B:\\Test\\PDF";
PdfWriter writer = PdfWriter.GetInstance(doc1, new FileStream(path + "/Doc1.pdf", FileMode.Create));
writer.PageEvent = new PDFWriterEvents("This is a Test");
doc1.Open();
//new XMLParser().Parse(new StringReader(text));
//XMLWorkerHelper.GetInstance().ParseXHtml(writer, doc1, new StringReader(text));
doc1.Add(list);
doc1.Close();
I am using the above code with the latest itextsharp to generate a pdf list. So far it's working very excellently, until when I want to convert each itextsharp
list from html to at least plain text, or preferably formatted text with images if possible. Someone please assist me convert q.Message
to pdf of plain text ready for rendering to pdf file with XMLWorker
and this code here .
//new XMLParser().Parse(new StringReader(text));
//XMLWorkerHelper.GetInstance().ParseXHtml(writer, doc1, new StringReader(text));
Please note that I am not getting the html from a file, it's from the database…