Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Jan 19, 2017 10:48 am

Good Morning,

I am having a very complicated problem using "LoadFromHTML" of Spire.Doc.
On the development PC with Windows 10 no problem, the PDF is properly generated; while installing the .NET project on a Windows Server 2003 SP2 when the PDF be generated start a process DW20.exe that occupies the 90-100% CPU making the server effectively blocked.
Can you help me?

The Code:
Code: Select all
String MyHTML = "<B>Hello World</B>";

PdfPageSettings pageSettings = new PdfPageSettings();
pageSettings.Margins = new Spire.Pdf.Graphics.PdfMargins(10, 10, 10, 10);
pageSettings.Orientation = PdfPageOrientation.Portrait;
pageSettings.Size = PdfPageSize.A4;
Spire.Pdf.HtmlConverter.PdfHtmlLayoutFormat htmlFormat = new Spire.Pdf.HtmlConverter.PdfHtmlLayoutFormat();
htmlFormat.FitToPage = Spire.Pdf.HtmlConverter.Clip.Both;

PdfDocument doc = new PdfDocument();
Thread thread = new Thread(() => { doc.LoadFromHTML(MyHTML, true, pageSettings, htmlFormat); });
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();

String FileNamePDF = "doc.pdf";
doc.SaveToFile(FileNamePDF);
doc.Close();


Thank you,

Alessandro

acioni
 
Posts: 1
Joined: Tue Jan 03, 2017 11:24 am

Fri Jan 20, 2017 2:36 am

Dear Alessandro,

Thanks for your inquiry.
From the code information, it shows you were using Spire.PDF to convert HTML to PDF.
And first we suggest you use the latest Spire.PDF Pack(Hot Fix) Version:3.8.158. If the issue still exists, there is some information may help you, please check.
https://answers.microsoft.com/en-us/win ... 6bbc33d807
http://www.outsystems.com/forums/discus ... o-100-cpu/
If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Jan 25, 2017 7:31 am

Dear Alessandro,

How is your issue now ?
Could you please give us some feedback at your convenience ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc