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 Mar 26, 2020 10:52 am

Dear E-IceBlue,

I got trouble with new HTML convert plugin.

Before that we use method

Case 1 - This work with image show
PdfDocument doc = new PdfDocument();
doc.LoadFromHTML

Case 2 - This method produce better quality PDF but currently failed to show image (sometime it show few images in html, sometime not at all). We set debug on image render module, and see that pdf generator even not make request to that image. Is there any problem with image loading in below command?

Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert

hecWorkwear
 
Posts: 11
Joined: Wed Feb 26, 2020 7:17 am

Fri Mar 27, 2020 1:48 am

Hello,

Thanks for your inquiry.
To help us investigate your issue more accurately, please provide your testing code, your URL (or HTML file) along with your output file for reference.
You could upload here or send them to us(support@e-iceblue.com) via email. Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Mar 27, 2020 7:28 am

Hi Rachel,

I don't have a custom reproduce at the moment.

Problem come when html use stylesheet to specify background-image: url('imageurl'); for multiple DIV tags.

Then Spire.Pdf.HtmlConverter.Qt.HtmlConverter. Convert finish the pdf generation before it download the image. Result is background image not show in PDF.

But when we try to change from background-image in style to <img> tag, all image shown. IE make request to images before PDF generated. Could it be some behavior in new plugin?

hecWorkwear
 
Posts: 11
Joined: Wed Feb 26, 2020 7:17 am

Fri Mar 27, 2020 8:46 am

Hello,

Thanks for your response.
Based on your description, I simulated a sample HTML file and then tested the below code, but the image could be rendered when converted to PDF. Attached are my input file and my output file. You could test it on your side.
If your HTML file has some extra settings, please share it with us to help us further investigate it. Thanks in advance.
Code: Select all
            string input = "sample.html";
            string outputFile = "ToPDF.pdf";
            Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(input,
            outputFile,
            true,
            10 * 1000,
            new SizeF(612, 792),
            new Spire.Pdf.Graphics.PdfMargins(0));


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu Apr 02, 2020 8:46 am

Hello,

Hope you are doing well.
Have you tested my case? Could you please give us some feedback at your convenience?
Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.PDF

cron