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.

Thu May 09, 2019 9:27 am

Hi,
After read all prevoious issues with "plugin", I didnt found a complete answer or solution for the simple thing "The conversion provider cann't be found"

my system:
. Visual Studio 2017
. Win 10
. Spire.PDF with active license

the plugin folder is exact under the same folder as the linked Spire.Pdf
Spire.PDF.5.4.21\lib\net46\
I have replaces the 4 Spire.x files inside with the HotFix Version form the ZIP NET4.6 Folder

my calling line:
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(htmlCode, outputFile, false, 100, new SizeF(612, 792), new PdfMargins(0));

by the way, one question:
what means Obsolete in the API reference for
Hi,
After read all prevoious issues with "plugin", I didnt found a complete answer or solution for the simple thing "The conversion provider cann't be found"

my system:
. Visual Studio 2017
. Win 10
. Spire.PDF with active license

the plugin folder is exact under the same folder as the linked Spire.Pdf
Spire.PDF.5.4.21\lib\net46\
I have replaces the 4 Spire.x files inside with the HotFix Version form the ZIP NET4.6 Folder

my calling line:
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(htmlCode, outputFile, false, 100, new SizeF(612, 792), new PdfMargins(0));

by the way, one question:
what means Obsolete ???
(can´t post an url ...)
public class HtmlConverter
Convert(String, String, Boolean, Int32, SizeF, PdfMargins)
Obsolete.
Convert an html page to a pdf file. The Qt html engine plugin is required.

I guess the API reference is too old?
Is there a link or a download to the newest API Reference?

Regards and Greetins
Winfried???

I guess the API reference is too old?
Is there a link or a download to the newest API Reference?

Regards and Greetins
Winfried

weinfreund
 
Posts: 7
Joined: Fri Apr 26, 2019 11:55 am

Thu May 09, 2019 9:57 am

Hi,

Please confirm your project platform should be in x86.
And make sure path in outputFile should be full path.

Thanks

wiseoption
 
Posts: 4
Joined: Tue May 07, 2019 4:33 pm

Thu May 09, 2019 10:43 am

Hello Winfried,

Thank you for contacting.
Yes, like Wiseoption posted that the plugin doesn’t support X64 very well, we suggest you test your case on X86. Here I upload a sample application for you, please check it on your side. If there is still any question, please provide your html file(if any), system configuration (E.g. Windows 7, 64 bit) and the region information (E.g. China, Chinese) to help us do a further investigation. You could send them to us via email(support@e-iceblue.com).

Sincerely,
Lisa
E-iceblue support team
User avatar

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

Thu May 09, 2019 10:45 am

Hi,

yes, i´ve tried it with x86 as well.


string outputFile = @"C:\html_report_checking\editHTML\20190503\Spire.pdf";

full path


Regards

weinfreund
 
Posts: 7
Joined: Fri Apr 26, 2019 11:55 am

Thu May 09, 2019 10:53 am

Hi Lisa,

strange, Your code works with "Any CPU" but not with x86........that will throw the error as I described before

weinfreund
 
Posts: 7
Joined: Fri Apr 26, 2019 11:55 am

Thu May 09, 2019 11:00 am

ok, I´ve moved in my project the plugin Folder to the Debug Folder byside the other .dll´s and that works.
my link for the Spire.Pdf in this project shows to my extra "Package" Folder, where I put everything external inside.
But the Plugin Folder wont accepted there......

weinfreund
 
Posts: 7
Joined: Fri Apr 26, 2019 11:55 am

Thu May 09, 2019 11:59 am

Now it works, but I got no pictures and the papersize is ignored.
I´ve sent an email with releated files.

Regards
Winfried

weinfreund
 
Posts: 7
Joined: Fri Apr 26, 2019 11:55 am

Fri May 10, 2019 6:42 am

Hello,

Thank you for sharing your Html file via email.
I did notice the “175_Report_banner.jpg” doesn’t display on top of page when using pdf.LoadFromHTML(htmlCode, true, setting, htmlLayoutFormat);. This issue has been forwarded to our Dev team for further investigating, if there is any update, we will keep you informed. However, It could work well when I test with plugin method. Please firstly make sure that the “175_Report_banner.jpg” is exact under the same folder as the OnlineCheck.html file. Besides, It supports setting the margin and the size of page when converting Html to PDF with plugin method. Below is my testing code.
Code: Select all
string input = @"F:\TF\UsingDemo\Htmltopdf\bin\Debug\OnlineCheck.html";
string outputFile = @"C:\result.pdf";
PdfUnitConvertor unitCvtr = new PdfUnitConvertor();
//set margin
PdfMargins margin = new PdfMargins();
margin.Top = unitCvtr.ConvertUnits(0.75f, PdfGraphicsUnit.Centimeter, PdfGraphicsUnit.Point);
margin.Bottom = margin.Top;
margin.Left = unitCvtr.ConvertUnits(1.75f, PdfGraphicsUnit.Centimeter, PdfGraphicsUnit.Point);
margin.Right = margin.Left;
//set pageSize
float width = unitCvtr.ConvertUnits(5f, PdfGraphicsUnit.Inch, PdfGraphicsUnit.Point);
float height = unitCvtr.ConvertUnits(8f, PdfGraphicsUnit.Inch, PdfGraphicsUnit.Point);
SizeF pageSize = new SizeF(width, height);
//convert Html to PDF
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(input,
outputFile,
//enable javascript
true,
//load timeout
10 * 1000,
  //page size
pageSize,
  //page margins
margin);

Sincerely,
Lisa
E-iceblue support team
User avatar

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

Fri May 10, 2019 2:42 pm

Thanks,

the graphics is visible now with this method:
Code: Select all
string testFile = @"C:\………";
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(testFile, outputFile, true, 10 * 1000, pageSize, margin);


I guess, the diffence is how I get the source code.... it works with getting the file direct, not thru a string how I does:

Code: Select all
string htmlCode = File.ReadAllText(testFile);
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert( htmlCode, output, false,  100, new SizeF(595, 842), new PdfMargins(25), LoadHtmlType.SourceCode);



but the papersize isn´t correct still, wether the extra defination with the converter:
Code: Select all
PdfMargins margin = new PdfMargins();
float width = unitCvtr.ConvertUnits(8.2f, PdfGraphicsUnit.Inch, PdfGraphicsUnit.Point);
float height = unitCvtr.ConvertUnits(11.68f, PdfGraphicsUnit.Inch, PdfGraphicsUnit.Point);
SizeF pageSize = new SizeF(width, height);


nor my
Code: Select all
new SizeF(595, 842)

works as expected..

the outputted PDF seems to zoomed smaller anyway

weinfreund
 
Posts: 7
Joined: Fri Apr 26, 2019 11:55 am

Mon May 13, 2019 8:13 am

Yes, the papersize is correct, thats my mistake in the description.

The PDF inside the correct paper is zoomed smaller, that´s the error.

I´ve tried everyhing, but without any correct result.

weinfreund
 
Posts: 7
Joined: Fri Apr 26, 2019 11:55 am

Mon May 13, 2019 10:24 am

Hello,

Thanks for your more information.
I did notice the content of generated PDF zoomed out when using the new plugin method, our Dev team will do further investigations, if there is any update, we will let you know. Sorry for the inconvenience caused.

Sincerely,
Lisa
E-iceblue support team
User avatar

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

Mon Jul 22, 2019 3:21 am

Hello,

Thanks for your patience.
Glad to inform that we have upgraded the Plugin of converting Html file to PDF, it fixed the "zoom out" issue. Please download the new Plugin from the following links and test.
Plugins-X86.zip: https://www.e-iceblue.com/downloads/Plugins/Plugins-X86.zip
Plugins-X64.zip: https://www.e-iceblue.com/downloads/Plugins/Plugins-X64.zip

Sincerely,
Lisa
E-iceblue support team
User avatar

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

Return to Spire.PDF