Can not convert background color from html to pdf with HTML tools

We are having an issue with the output produced by VeryPDF HTMLTools that appears to be related to page splitting. We have previously reported an issue where images on the final page of the generated output were missing. The addition of the -playemf2 command switch repaired that. We now have a futher issues that again appears to be images disappearing when page splitting is in use. An example faulty output can be seen in the attached zip ReplicationSteps.zip. The image below on the left is part of the the MHTML file and correctly shows three ticks against the appropriate items in the table. The image on the right is part of the PDF generated on a Windows Server 2003 R2 SP2 machine with IE 8.0.6001.18702 and shows no ticks at all on the first page. If the –emfheight attribute is removed the ticks are present.

To replicate the issue simply:
1)      Extract the contents of ReplicationSteps.zip
2)      Execute the MakePDF.bat
3)      Compare the output produced to pji3946.mht

Also included is MakePDF-NoPageSplit.bat that removes the –emfheight switch. This shows the output without page splitting where all the ticks required are then shown.

This is now impacting on a production environment so a speedy response would be appreciated

Thanks in advance
==========================================
Thanks for your sample files, we will research this problem shortly.

In the meantime, we suggest you may download HTMLPrint to Any Converter product from our website to try, this product can convert HTML file to PDF file too,

http://www.verydoc.com/htmlprint-to-any.html

http://www.verydoc.com/htmlprint2any_cmd.zip

after you unzip it to a folder, you can run following command line to convert your HTML file to PDF file properly,

html2any.exe -printtopdf C:\verypdf.pdf https://www.verypdf.com

HTMLPrint to Any Converter product does use printing technology to convert HTML file to PDF file, so it hasn't limitations in htmltools.exe application, we hoping HTMLPrint to Any Converter product will helpful to you. If you wish exchange htmtools.exe with html2any.exe, please feel free to let us know, we will arrange an exchange to you shortly.

VeryPDF
==========================================
Can I get an update on this issue please?

So that I can confirm if switching to the other tool is an option, can you confirm the cost difference?

Thanks
==========================================
We apologize for any inconvenience this may have caused to you, we haven’t solved this problem in htmltools.exe yet, in the meantime, we suggest you may use our other products to convert this HTML file to PDF file, our other products can convert this HTML file to PDF file correctly,

HTMLPrint to Any Converter,
http://www.verydoc.com/htmlprint-to-any.html

Doc Converter COM Component,
https://www.verypdf.com/pdfcamp/pdfcamp.htm#dl

Document Converter (docPrint Pro) v5.0,
https://www.verypdf.com/artprint/index.html#dl

above products all can convert your HTML file to PDF file correctly, you may download one of them from our website to try.

VeryPDF
==========================================
We have already purchased licences for HTMLTools.  What would the difference in licencing be if we had to switch to one of these other products?

Regards
==========================================
Yes, you can switch to other products, can you please email to us your Order ID and tell us what product would you like switch to?

VeryPDF
==========================================
I have tried a few of the alternative PDF converter applications and the one that achieves the closest results is the Doc2PDF (alias HTML2PDF). However, it does not seems to add any background colours to the PDF document produced. Do you know of any solutions around this problem?

Below are examples of the output along with an extract of the mhtml that creates this:

Original MHTML Doc

Converted PDF Doc

MHTML used to generate the background colours (from stylesheet):

.rowbackgroundalternate {
background-color: #E7E3E4;
}

Setting the background-color attribute to different Hex colours has no effect.
==========================================
You can use "PrintHTMLBackground=yes" parameter to print background color and images from HTML file to PDF file, for example,

Convert background color and images within html to pdf conversion,

"html2pdf.exe" "https://www.verypdf.com/pdfcamp/pdfcamp.htm" "C:/output.pdf" "PrintHTMLBackground=yes"

"html2pdf.exe" "https://www.verypdf.com/pdfcamp/pdfcamp.htm" "C:/output.pdf" "PrintHTMLBackground=no"

VeryPDF
==========================================
Thanks for your response. I tried adding the PrintHTMLBackground option but it made no difference, either with my MHTML file or with the web address you provided as an example (https://www.verypdf.com/pdfcamp/pdfcamp.htm). I have also tried altering some of the properties on the docPrint print driver it uses but nothing seems to affect the background. Do you have any other suggestions?
==========================================
Please refer to following screenshot, please select “print background colors and images” option in IE, then you can convert background colors and images from HTML file to PDF file properly.

image

This option is depend on user account, so you need select this option in every user’s account.

VeryPDF
==========================================
The option to “print background colors and images” is already selected in Internet Explorer.

I have attached the output from running the following command:

"html2pdf.exe" "https://www.verypdf.com/pdfcamp/pdfcamp.htm" "C:/output.pdf" "PrintHTMLBackground=yes"

As you can see in the attachment, the table after “PDFcamp Printer (PDF Writer) and PDFcamp Printer Pro Price” has no background but when you browse in IE to the same web page the table does have background information.

Would it be possible to send me your output when running the above command so I can confirm that it is an issue with the computer I am using rather than with the software?

Many thanks,
==========================================
Please look at attached PDF file, this PDF file was created by following command line, everything is fine in this PDF file,

"html2pdf.exe" "https://www.verypdf.com/pdfcamp/pdfcamp.htm" "C:/output.pdf" "PrintHTMLBackground=yes"

If possible, please create a remote desktop account on your test machine, after we logged into your test machine, we will research this problem for you asap.

VeryPDF
==========================================
Would it be possible to investigate this issue again? The project was put on hold but has since re-opened. The issue is described in the email chain below but here is a summary:

The issue is with the Doc2PDF (alias HTML2PDF) software. It does not print the backgrounds on the PDF file even with "PrintHTMLBackground=yes" and with Internet Explorer set to "Print Background Colours and Images". I have tried this on numerous machines but none of them print the backgrounds. I have attached the original mhtml file I used to convert to the PDF and also the actual PDF output it produces. The command line I used to generate the PDF is:

html2pdf.exe "C:\Program Files\doc2pdf_com_trial\Bad.mht" "C:\output.pdf" "PrintHTMLBackground=yes"

You suggested last time to use LogMeIn remote software so you can investigate for yourselves. I will have to arrange this with my manager here if this is still required. Otherwise, do you have any further ideas as to why the backgrounds are not showing up?

Many thanks,
==========================================
Thanks for your kindly assistance, after you assist me to switch from HTMLtools to html2pdf doc converter COM component, everything is work fine now.
==========================================

Thanks for your information.

VeryPDF

VN:F [1.9.20_1166]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.20_1166]
Rating: +1 (from 1 vote)
Can not convert background color from html to pdf with HTML tools, 10.0 out of 10 based on 1 rating

Related Posts

One Reply to “Can not convert background color from html to pdf with HTML tools”

  1. How to catch the error on DocConverter Com (html2pdf.exe)

    We call html2pdf.exe in our application. However we don’t know how to catch the error incase the converting failed (the problem could be for example: input is too big or don’t have enough disk space or so) ?

    Many thanks.
    Huong

    VA:F [1.9.20_1166]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.20_1166]
    Rating: 0 (from 0 votes)

Leave a Reply to Huong Cancel reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!