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.

Tue Jul 16, 2019 8:47 am

Hello Master's, I need your help, I'm new to this
I've recently installed the Free Spire.PDF. using new plugins to convert .html to pdf It successfully work like a charm, It created 2 pages of pdf and barcodes. However when I publish it , it does not convert the .html to pdf. I created a text log file to check the plugins path.

I read the other post: Convert HTML to PDF with New Plugin
plugin: vcredist_x86
using: ms visual studio 2008 vb

This the sample actual code -----this statement not converting the .html to pdf Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(strMessage, FilePath, True, 10 * 100, New SizeF(612, 792), New Spire.Pdf.Graphics.PdfMargins(0), LoadHtmlType.SourceCode)


Code: Select all
Dim thread As New Thread(AddressOf work)
thread.SetApartmentState(ApartmentState.STA)
thread.Priority = ThreadPriority.AboveNormal
thread.Start()
thread.Join()

Public Function work() As PdfDocument
Dim doc As New PdfDocument()
Dim pluginDir As String = WebConfigurationManager.AppSettings("PluginDir").ToString()
pluginDir = pluginDir & "\bin\plugins"
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.PluginPath = pluginDir
Dim FilePath As String = Path.Combine(RCS1Path, "E-RCS") & ".pdf"
Dim font As PdfFont = New PdfFont(PdfFontFamily.Helvetica, 5)
Dim brush As PdfBrush = PdfBrushes.Black
Dim richTextElement As PdfHTMLTextElement = New PdfHTMLTextElement(strMessage, font, brush)
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(strMessage, FilePath, True, 10 * 100, New SizeF(612, 792), New Spire.Pdf.Graphics.PdfMargins(0), LoadHtmlType.SourceCode)
        Return doc
 End Function


Thank you and Best Regards,
henley
"type by my fingers"
Last edited by jdispo on Tue Jul 23, 2019 7:12 am, edited 1 time in total.

jdispo
 
Posts: 19
Joined: Wed Jul 03, 2019 7:21 am
Location: Philippines

Tue Jul 16, 2019 9:41 am

additional question... maybe this will fix it... Do I need to install the free spire pdf on our server?

jdispo
 
Posts: 19
Joined: Wed Jul 03, 2019 7:21 am
Location: Philippines

Tue Jul 16, 2019 10:12 am

Hello,

Thanks for your inquiry.
It doesn't need to install the free Spire.PDF on publishing server, you just make sure that you referenced the dlls of our product from your local project folder. To help us investigate and locate your issue accurately, please share us with the following more information. You could send them to us via email ([email protected]). Thanks in advance.
1. The string content of "strMessage".
2. How did you publish it? Did you publish it on IIS or Azure server?
3. Did you get any error message when publishing? if yes, please also share a screenshot of it with us.
4. Your system information (E.g. Windows 7, 64 bit) and region setting (E.g. China, Chinese)

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Wed Jul 17, 2019 1:58 am

Hi Lisa,

Thank you.

1. The string content of "strMessage".
Dim strPath As String = String.Empty
strPath = MapPath("TheHTML.htm")
Dim strMessage As String = File.ReadAllText(strPath, Encoding.UTF8)
strMessage = strMessage.Replace("[FirstName]", labelFirstname.Text) and so on..
2. How did you publish it? Did you publish it on IIS or Azure server?
-on IIS server
3. Did you get any error message when publishing? if yes, please also share a screenshot of it with us.
- none

4. Your system information (E.g. Windows 7, 64 bit) and region setting (E.g. China, Chinese)
- windows 10 64 bit. region philippines

jdispo
 
Posts: 19
Joined: Wed Jul 03, 2019 7:21 am
Location: Philippines

Wed Jul 17, 2019 2:16 am

adding screenshots..
Spire Reference.PNG

Spire Reference part 1.PNG

Spire Reference.PNG

jdispo
 
Posts: 19
Joined: Wed Jul 03, 2019 7:21 am
Location: Philippines

Wed Jul 17, 2019 3:45 am

adding comment..

Hello Lisa,
I read the Spire.PDF Free Edtion API


I used the "PluginPath" correctly..
*Sets the path of the folder which cantains the HTMLConverter.dll and other dll files required for conversion. *

then
And this "Convert(String, String, Boolean, Int32, SizeF, PdfMargins, LoadHtmlType)".
*Convert an html page to a pdf file. The Qt html engine plugin is required.*

jdispo
 
Posts: 19
Joined: Wed Jul 03, 2019 7:21 am
Location: Philippines

Wed Jul 17, 2019 6:33 am

Hi Lisa, When I added this "Imports Spire.Pdf.HtmlConverter.Qt"

Found this error:
Error converting: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"

but I already gave the path and returns this string C:\inetpub\wwwroot\test\website\bin\plugins

this is the content of PluginDir = C:\inetpub\wwwroot\test\website

Dim pluginDir As String = WebConfigurationManager.AppSettings("PluginDir").ToString()
pluginDir = pluginDir & "\bin\plugins"
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.PluginPath = pluginDir

Code: Select all
Imports System.Drawing
Imports Spire.Pdf
Imports Spire.Pdf.Graphics
Imports Spire.Pdf.HtmlConverter
Imports Spire.Pdf.HtmlConverter.Qt
Imports Spire.Pdf.Barcode
Imports System.Reflection
Imports System.Threading

jdispo
 
Posts: 19
Joined: Wed Jul 03, 2019 7:21 am
Location: Philippines

Wed Jul 17, 2019 8:12 am

Hi Lisa, maybe this is the error on server
without c++ header.PNG


on my laptop:
c++ header.PNG


im using visual studio 2008 and the server is 2012 r2

I guess I need to install this in the server? Microsoft Visual C++ 2008 Redistributable Package (x86) ??

jdispo
 
Posts: 19
Joined: Wed Jul 03, 2019 7:21 am
Location: Philippines

Wed Jul 17, 2019 8:35 am

Hello,

Thanks for your more information.
I simulated your scenario and tested with Free Spire.PDF for .NET Version:5.4, but I didn't encounter your issue. When publishing on IIS, please set "true" for "Enable 32-Bit Application" like the attached screenshot. Here, I uploaded my simple testing application. Please have a check and then let us know your testing result. Look forward to your further feedback.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Wed Jul 17, 2019 9:56 am

Hi Lisa,
Thank you for the response.

After setting it to true the Enable 32-Bit Application and installing the Microsoft Visual C++ 2008 and 2010 Redistributable Package (x86).

The error still says :
Error converting: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"

jdispo
 
Posts: 19
Joined: Wed Jul 03, 2019 7:21 am
Location: Philippines

Wed Jul 17, 2019 10:31 am

Hello,

Thanks for your quick feedback.
How about the testing result when publishing my uploaded application on your system? Besides, please share us the detailed information of your IIS settings. Thanks in advance.

Sincerely,
Lisa
E-icbelue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Wed Jul 17, 2019 12:37 pm

Hi Lisa, I tested it first on my laptop it works. But when I published it the same error occurs :( :( :( :( then just in case will work I also copied your dlls and plugins then
I put the plugins and spire in the bin folder but it is a no :( .

jdispo
 
Posts: 19
Joined: Wed Jul 03, 2019 7:21 am
Location: Philippines

Thu Jul 18, 2019 8:54 am

Hello,

Thanks for your feedback.
Based on your IIS setting screenshot, I found your ".NET CLR Version" is v2.0, kindly note that my uploaded sample application used the Spire.PDF.dll from folder NET4.0, please firstly make sure their versions are the same. Besides, as for your situation, please install the "vcredist_x86.exe" on your publishing server and try it again. Look forward to your feedback.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Thu Jul 18, 2019 9:28 am

Hell Lisa,

Thank you for your feedback,

May I ask if this "vcredist_x86.exe" that you are telling me to install is the one that was in plugin folder??

jdispo
 
Posts: 19
Joined: Wed Jul 03, 2019 7:21 am
Location: Philippines

Thu Jul 18, 2019 9:35 am

Hello,

Yes, the "vcredist_x86.exe" is in the plugin folder. Just feel free to write back if any question.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF

cron