I'm using iText7 to convert from HTML to PDF which runs perfectly
however this call:
HtmlConverter.ConvertToPdf(htmlStream, document);
will close the document after it's called but I don't want to close the document yet for the following reason
I wrote this function to write pages I'll be calling it in a loop
public static void WritePage(string htmlbody)
{
document.AddNewPage();
byte[] htmlByteArray = Encoding.UTF8.GetBytes(htmlbody);
MemoryStream htmlStream = new MemoryStream(htmlByteArray);
HtmlConverter.ConvertToPdf(htmlStream, document);
}
and after the loop is over I'll close the document my self
public static void CloseDocument()
{
document.Close();
}
this worked when I was using iText5 but now the convertToPdf will close the document. I can read from that document and add it with the new page to a new document but I don't want to do that I want to utilize the built in document.AddNewPage and after the document is fully constructed I'll close it myself
Thank you in advance