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.

Fri Oct 01, 2021 12:24 pm

Spire.PNG
Hi ,

I am using spire.pdf with our Web application and also tried in web site(ASP.NET web C# ) to generate HTML string to PDF file using html to pdf with new plugins. The problem is that the PDF file is generated correctly on my Local development machine, but when I deploy the same web application on our Internal Web Server, the PDF generation does not work and the page throws an error "The conversion provider cann't be found. Please make sure the folder "plugins" is under the same folder of Spire.Pdf.dll."

I have already placed plugins folder and spire.pdf.dll is under the same bin folder of web application based on your documentation. Please find the attached image and let us know how to resolve this issue.

I downloaded and used the "windows-x86.zip " plugins to generate HTML string to PDF file

Internal Web Server details :Windows server® standard service pack2, 32 bit OS.

JayanthiJaya
 
Posts: 22
Joined: Thu Jan 21, 2021 6:06 am

Mon Oct 04, 2021 2:04 am

Hello,

Thanks for your inquiry.

Our Spire.PDF also supports specifying the plugin path. I suggest that you manually set the path of the plugin through the by the sample code below before conversions to ensure that Spire.PDF finds the plugin correctly. Hope it can help you.
Code: Select all
HtmlConverter.PluginPath = "Your Plugin Path";
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Mon Oct 04, 2021 5:38 am

Hi ,

We also tried that manually set the path of the plugin folder path into our sample code but still getting an same error( "The conversion provider cann't be found. Please make sure the folder "plugins" is under the same folder of Spire.Pdf.dll."). Please find the attached screenshot and help us how to resolve this issue.

JayanthiJaya
 
Posts: 22
Joined: Thu Jan 21, 2021 6:06 am

Mon Oct 04, 2021 12:10 pm

Hi,

Thanks for your response.
I simulated a simple 32-bit web project and tested it with the corresponding plugin. But I did not get the error you mentioned. I have uploaded my test project. You can download it from the link below to test and see if it can run successfully in your environment.
https://briansharepoint-my.sharepoint.c ... Q?e=z9HlEW
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Mon Oct 04, 2021 12:28 pm

Ok thank you . I will try and let you know .

JayanthiJaya
 
Posts: 22
Joined: Thu Jan 21, 2021 6:06 am

Wed Oct 06, 2021 10:45 am

Hi ,

I could not able to open the project (which you send me) due to this error. Could you please send me the correct solution to test this.

JayanthiJaya
 
Posts: 22
Joined: Thu Jan 21, 2021 6:06 am

Thu Oct 07, 2021 3:10 am

Hello,

Thanks for your feedback!

I guess this issue may be because your Visual Studio does not trust the project downloaded from the Internet, please click the "OK" button to continue loading the project.

Or you can change the setting of your Visual Studio refer to the following article:

https://stackoverflow.com/questions/31187339/disable-you-should-only-open-projects-from-a-trustworthy-source-message-in-vs.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Thu Oct 07, 2021 1:20 pm

Hi,

After installed the "vcredist_x86.exe" in to our server and the error("The conversion provider cann't be found") is not thrown now.

But,This line of code is now not generating html to pdf.

Note:In my local it is working fine . The problem only in server. Please let me know what can I do for this problem.

string stroutput = @"D:\output.pdf";
HtmlConverter.Convert("<html><body><p>Test The Plugins</p></body></html>", stroutput, true,10000,new System.Drawing.SizeF(500,700),
new Spire.Pdf.Graphics.PdfMargins(0),Spire.Pdf.HtmlConverter.LoadHtmlType.SourceCode);

JayanthiJaya
 
Posts: 22
Joined: Thu Jan 21, 2021 6:06 am

Fri Oct 08, 2021 10:39 am

Hi,

Thanks for your feedback.
According to your code, I did some tests on Windows Server, but the PDF documents can be generated successfully. This issue may be related to file permissions. I suggest you change the file path and try again. If the problem persists, in order to help us investigate further, please provide your test project. Thanks in advance.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Mon Oct 11, 2021 1:25 pm

Hi,

I need your help, I'm new to this still the pdf file is not getting generated when I test from the server. However when I publish it does not convert the .html to pdf and also .html to memory stream. I did not get any error. Herewith I have attached a word file which has contains details about my test app IIS setting ,sample code and html file text from the server.

JayanthiJaya
 
Posts: 22
Joined: Thu Jan 21, 2021 6:06 am

Mon Oct 11, 2021 1:30 pm

I checked the file permission and the files has read and write access.

JayanthiJaya
 
Posts: 22
Joined: Thu Jan 21, 2021 6:06 am

Tue Oct 12, 2021 6:08 am

hi,

Is there any update pls. My local code returns the length of the stream but it returns the length count 0 and it does not convert .html to pdf when generate from the server . I published with the same code only in server

Please do the needful help. Thanks in advance!

/save the pdf file directly to the given location
//HtmlConverter.Convert("<html><body><p>sample text</p></body></html>", strOutputFileName, true, 10000, new System.Drawing.SizeF(500, 700),
// new Spire.Pdf.Graphics.PdfMargins(0), Spire.Pdf.HtmlConverter.LoadHtmlType.SourceCode);

//save the html string to memorystream
HtmlConverter.Convert(@"D:\spire\HtmlPage1.html", memoryStream,
true, 10 * 1000, new SizeF(612, 792), new Spire.Pdf.Graphics.PdfMargins(70, 30, 80, 80));

byte[] bytesdata = memoryStream.ToArray();

FileLogger.LogEvent("html array length " + memoryStream.Length.ToString());

File.WriteAllBytes(@"D:\spire\htmltoPDF_fromByteData.pdf", bytesdata);//save the pdf to local folder

JayanthiJaya
 
Posts: 22
Joined: Thu Jan 21, 2021 6:06 am

Tue Oct 12, 2021 10:22 am

Thanks for your sharing.
Based on your code, I simulated a test project and tested it again, but I still did not reproduce the issue. I have attached all my test information, including project, release files, IIS configuration information, plugins, etc. You can download them from the link below for testing.
Besides, I noticed that the only different configuration between us is that your OS is 32-bit and mine is 64-bit. Sorry we don't have a 32-bit system. It may prevent you from generating PDF. We suspect that this issue may be related to your environment. We suggest you also try to test on other servers.
https://www.e-iceblue.com/downloads/demo/27048Demo.zip
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Wed Oct 13, 2021 6:18 am

Hi Andy,

I tested in 64-bit OS. The PDF is generated properly. Thank you so much :D

Just I wanted to confirm, will this not work if I not install the "vcredist_x86.exe" to our server.

JayanthiJaya
 
Posts: 22
Joined: Thu Jan 21, 2021 6:06 am

Wed Oct 13, 2021 9:36 am

Hello,

Thanks for your response.
You do need to install "vcredist_x64.exe" or "vcredist_x86.exe" base on your system environment to ensure that the QT plugin works as expected.
If you have any other questions about our products, please feel free to contact us.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Return to Spire.PDF

cron