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"