- Code: Select all
PdfDocument doc = new PdfDocument();
PdfHtmlLayoutFormat htmlLayoutFormat = new PdfHtmlLayoutFormat();
htmlLayoutFormat.IsWaiting = false;
htmlLayoutFormat.Layout = PdfLayoutType.Paginate;
PdfPageSettings setting = new PdfPageSettings();
setting.Size = PdfPageSize.A4;
Thread thread = new Thread(() =>
{ doc.LoadFromHTML(real_all_content, false, setting, htmlLayoutFormat); });
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();