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.

Wed Jan 15, 2014 8:03 pm

Hi,

I am having some trouble converting an html page to pdf.

So far, I have tried the LoadFromHTML method e.g. doc.LoadFromHTML(url, false, true, true);
This seems to only take screenshots of the webpage and safe as an image in the pdf.

I am looking to save the html page as text so it can be selectable in the pdf.

I have also tried the HtmlConverter.Convert method suggested from the forums. The method is showing as “deprecated” and “obsolete”. When run, it returns an error “An unhandled exception of type 'System.InvalidOperationException' occurred in Spire.Pdf.dll Additional information: The conversion provider cann't be found.”

I have updated my spire.pdf with the newest plugin.

Thanks.

samuelng
 
Posts: 3
Joined: Wed Jan 15, 2014 1:43 am

Thu Jan 16, 2014 2:17 am

Hello,

Thanks for your inquiry.
At present we have two methods to convert HTML to PDF as you know, and the HtmlConverter.Convert method is a beta method, maybe it will be merged with the other method in the future, so there is the warning message you get.
Regarding the error you experienced when run, please make sure if the version of HtmlConverter you downloaded and the position you added are correct, you could get more detailed information from the following link.
http://www.e-iceblue.com/Knowledgebase/ ... o-PDF.html
If there are still the error, please provide us the below information, which will help us reproduce the issue and offer you the solution ASAP.
1. Dll file list (name + version), for example:
Spire.Doc.dll v4.9.32.3040
Spire.License.dll v4.9.32.3040
Spire.Pdf.dll v2.8.86.3040
2. Operation System, for example:
Windows 7 Enterprise Edition SP1 x64
Regional and Language Options
3. Project can reproduce the issue
All code about this problem, a simple project which can reproduce this problem will be better.
4. Test Document or Test data
Please provide your test document to us if convenient, it may help us reproduce your issue quickly. We promise to keep your document confidential and we will not use it for any other purpose. Besides, you could also remove the security data of your document and then send it to us.

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Jan 16, 2014 2:52 am

Hi Gary,

Thanks for the response. Unfortunately the problem is still occurring.

I am currently running a demo version of Spire.Pdf
I do not have a spire.doc.dll
spire.pdf.dll 2.9.13.5040
spire.license.dll 1.3.2.40

Windows 8.1 Enterprise x64

Code: Select all
HtmlConverter.Convert("http://www.wikipedia.org/", "HTMLtoPDF.pdf", true, 100 * 1000, new SizeF(700, 880), new PdfMargins(0, 0));
            //HtmlConverter.Convert("C:\\Users\\sam\\Desktop\\acquire home.htm", "HTMLtoPDF.pdf");

            //Launching the Pdf file.
            PDFDocumentViewer("HTMLtoPDF.pdf");

samuelng
 
Posts: 3
Joined: Wed Jan 15, 2014 1:43 am

Thu Jan 16, 2014 6:31 am

Hello,

Thanks for your prompt reply.
Please download the demo(http://www.e-iceblue.com/downloads/temp/SS-2206.zip) and try again.
About how to use the new plugin, you could get more detailed information from the following link.
http://www.e-iceblue.com/Knowledgebase/ ... o-PDF.html
If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Mon Jan 20, 2014 1:36 am

Hi Gary,

This was very helpful. It is now working.

One question about the converter. Is it able to convert hyperlinks to the pdf? At the moment my hyperlinks are showing as regular text.

Thanks.

samuelng
 
Posts: 3
Joined: Wed Jan 15, 2014 1:43 am

Mon Jan 20, 2014 3:59 am

Hello,

Thanks for your feedback.

Sorry that it is not able to convert hyperlinks to the pdf. Sorry for inconvenience.

If there are any questions, welcome to get it back to us.

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.PDF