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 Nov 07, 2017 2:27 pm

hello, I also get this problem, when I put "Microsoft.mshtml.dll" in bin path, I can get a raster pdf, not vector pdf, my server is windows server 2012, IE 11. when run on my develop computer I can get the high quality verctor words pdf, my computer is window 7 x64 IE 8

fy1
 
Posts: 2
Joined: Sat Oct 21, 2017 11:20 am

Wed Nov 08, 2017 7:09 am

Hello fy1,

Thanks for your inquiry.
Yes, the result relies much on the IE kernel. When the IE version is 9 or above, the pdf will be a raster image. While the IE version below 9 will result in text content. Therefore, the only better way to avoid this is using the new method of plugin. Please refer to the following guidance.
https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Convert-HTML-to-PDF-with-New-Plugin.html

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Nov 10, 2017 8:57 am

Hello,

Greetings from e-iceblue!
How is your issue now?
Your feedback will be greatly appreciated.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Nov 13, 2017 9:45 am

thank you very much, I have change use itextSharp, resolve this problem

fy1
 
Posts: 2
Joined: Sat Oct 21, 2017 11:20 am

Mon Nov 13, 2017 10:02 am

Hi fy1,

Thanks for your feedback.
Please feel free to contact us if you need any other help.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Sat Oct 26, 2019 9:39 am

i am also having the same problem but didn't understand how to resolve below is my code please suggest

Dim doc As New PdfDocument()
Dim pgSt As New PdfPageSettings()
pgSt.Size = PdfPageSize.A4
pgSt.SetMargins(0.5, 0.5, 0.5, 0.5)

Dim htmlLayoutFormat As New PdfHtmlLayoutFormat()
htmlLayoutFormat.IsWaiting = False


Dim htmlpath As String = "D:\Print-code\test3.html"
Dim source As String = File.ReadAllText(htmlpath)
doc.LoadFromHTML(source, True, pgSt, htmlLayoutFormat)

doc.PrintSettings.PrintController = New StandardPrintController()
doc.PrintSettings.PrinterName = printer
'doc.PrintSettings.Copies = 2
'Print all pages with default printer
doc.Print()

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
error message
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.msht
ml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one
of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToke
n=b03f5f7f11d50a3a'
at Spire.Pdf.HtmlConverter.HtmlConverter.?(String A_0, ImageType A_1, Int32 A
_2)
at Spire.Pdf.HtmlConverter.HtmlConverter.Convert(String url, ImageType type,
Int32 width, Int32 height, AspectRatio aspectRatio)
at Spire.Pdf.PdfSection.?(String A_0, Boolean A_1, Boolean A_2, Boolean A_3,
PdfHtmlLayoutFormat A_4)
at Spire.Pdf.PdfDocument.LoadFromHTML(String htmlSourceCode, Boolean autoDete
ctPageBreak, PdfPageSettings setting, PdfHtmlLayoutFormat layoutFormat, Boolean
isLoadComplete)
at Spire.Pdf.PdfDocument.LoadFromHTML(String htmlSourceCode, Boolean autoDete
ctPageBreak, PdfPageSettings setting, PdfHtmlLayoutFormat layoutFormat)
at SP.Module1.Main() in D:\Nikhil\Project\PrintDocument\SP\Module1.vb:line 96


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\M
icrosoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure lo
gging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fus
ion!EnableLog].

nikhil.bhivgade
 
Posts: 1
Joined: Fri Oct 11, 2019 6:44 am

Mon Oct 28, 2019 5:52 am

Hi,

Thanks for your inquiry. Sorry for reply late for weekend.

Kindly note that Spire.PDF relies on the IE browser while converting Html file to Pdf file. Please make sure you have installed the IE browser firstly and try to reference the Microsoft.mshtml.dll in your project.
In addition, there is another method as below to convert html to pdf you can try, the method doesn't rely on the IE browser.
https://www.e-iceblue.com/Tutorials/Spi ... lugin.html

If the issue still exist after trying, please offer us the following information for further investigation.
1. A runnable project which could reproduce your issue directly.
2. The OS and Region information, e.g. Win7 64bit, China/Chinese.
You could upload them here or send us(support@e-iceblue.com) via email.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.PDF