Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Aug 03, 2020 5:00 am

Hi Team,
Thread is not working for SPIRE PDF after deploying in azure. It is working perfect in Local environment.
I am getting below issue please help me out on this issue.
Below is code what I am using
PdfDocument doc = new PdfDocument();
PdfHtmlLayoutFormat htmlLayoutFormat = new PdfHtmlLayoutFormat();
htmlLayoutFormat.IsWaiting = true;
htmlLayoutFormat.LoadHtmlTimeout = 30000;
Thread thread = new Thread(() =>
{ doc.LoadFromHTML(htmlCode, true, setting, htmlLayoutFormat); });
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();

I am getting error while calling doc.LoadFromHTML(htmlCode, true, setting, htmlLayoutFormat)

manojraog
 
Posts: 11
Joined: Mon Aug 03, 2020 4:51 am

Mon Aug 03, 2020 6:32 am

Hello,

Thanks for your inquiry.
On Azure, we suggest you use plugin method to convert html to PDF. Meanwhile, when using the x64 plugin, please make sure you have changed the platform of the general settings to 64 Bit, you can refer to this post (https://www.e-iceblue.com/forum/the-conversion-provider-cann-t-be-found-t9410.html).
If there are any questions, please get back to us ASAP.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Aug 03, 2020 6:43 am

Hello, Thanks for your reply..

For the plugin method we are not able to get CSS what we expecting. Also I got below issue while using plugin method.
The conversion provider cann't be found. Please make sure: 1. the folder "plugins" under the same folder of Spire.Pdf.dll 2. exists "plugins\HTMLConverter.dll" and other "plugins\*.dll" at Spire.Pdf.HtmlConverter.Qt.HtmlConverter.init(String url, Boolean enableJavaScript, Int32 timeout, SizeF pageSize, PdfMargins margins) at Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(String url, String fileName, Boolean enableJavaScript, Int32 timeout, SizeF pageSize, PdfMargins margins) at Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(String url, String fileName, Boolean enableJavaScript, Int32 timeout, SizeF pageSize, PdfMargins margins, LoadHtmlType urlHtml)

How to configure plugin path in our code if we use PLUGIN Method.

Please provide solution for LOADFromHTML method
we are using spire.pdf version: 5.6.3.18046
spire.doc version: 7.6.2.18046

manojraog
 
Posts: 11
Joined: Mon Aug 03, 2020 4:51 am

Mon Aug 03, 2020 10:33 am

Hello,

Thanks for your prompt response.
In fact, the plugin method performs better than the normal method. And there are indeed some problems when using the normal method to convert html to PDF on Azure, sorry there is no good solution to solve it at present.

Regarding the CSS style issue you mentioned, please provide your URL or html file for our further investigation.

As for error "The conversion provider cann't be found" you got, are you using the x64 plugin? If so, as I mentioned earlier, please make sure you have changed the platform of the general settings to 64 Bit (as shown below). And make sure the folder "plugins" is under the same folder of Spire.Pdf.dll in your Azure application.
Platform_settings.png

If this does not solve your issue, please provide your project to help us further look into it. You could upload it to the DropBox or OneDrive and then share the download link with us. Thanks in advance.


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Aug 03, 2020 11:00 am

Hi Rachel,
Thanks for your support
As you mentioned plugins and spire.pdf.dll are in same folder.
could you please tell me how to configure plugin path from code level with an example.
Also please let us know is there any specific way to add external CSS to html raw code.
we are using in the following way

string cssStyles = System.IO.File.ReadAllText(Server.MapPath(@"/StaticContent/CSS/MVC/xyz/abc.css"));
string htmlCode = "<html><head><style type='text/css'>" + cssStyles + "</style></head><body>" + htmlText + "</body></html>";

manojraog
 
Posts: 11
Joined: Mon Aug 03, 2020 4:51 am

Tue Aug 04, 2020 4:19 am

Hi Rachel,

Due to company policy I am unable to share code. Is it possible to have small discussion over zoom or any other source, So that you can have more clarity on the issue what we are facing. Please let us know. Also please respond to above question too.

Thanks in advance

manojraog
 
Posts: 11
Joined: Mon Aug 03, 2020 4:51 am

Tue Aug 04, 2020 7:09 am

Hello,

Thanks for your response.
Regarding configuring plugin path and adding external CSS, here I made a demo for you, please run it directly on your side.
http://www.e-iceblue.com/downloads/demo/22400Demo.zip

Besides, you can contact us directly (support@e-iceblue.com) via email.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Tue Aug 11, 2020 10:28 am

Hello,

Greetings from E-iceblue!
Could you please let us know how is the issue going? Thanks in advance for your feedback and time.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.PDF