Can someone help me to solve this question?
I've used your code from the demo page
- Code: Select all
string myDirectory = DCO.FileServerPath("XXX") + @"XXXX\eTicketReceipt\";
DirectoryInfo myDir = new DirectoryInfo(myDirectory + @"\XXXXXXXX\");
string myDirFullName = myDir.FullName;
string mySource = myDirFullName + "eTicket.html";
string myOutPut = myDirFullName + "eTicket.pdf";
PdfDocument pdf = new PdfDocument();
PdfHtmlLayoutFormat htmlLayoutFormat = new PdfHtmlLayoutFormat();
htmlLayoutFormat.IsWaiting = false;
PdfPageSettings setting = new PdfPageSettings();
setting.Size = PdfPageSize.A4;
string htmlCode = File.ReadAllText(mySource);
Thread thread = new Thread(() =>
{ pdf.LoadFromHTML(htmlCode, true, setting, htmlLayoutFormat); });
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
pdf.SaveToFile(myOutPut);
System.Diagnostics.Process.Start(myOutPut);
It can work, I can create a PDF file, but the pdf file's content just only show a little.
I find the missing content is exist, just can't see, seems it's font color is transparent.
thanks