Convert HTML to PDF with Background Colors and Images | VeryPDF Cloud API & PDF Tools

Convert HTML to PDF with Background Colors and Images Using VeryPDF Solutions

Question from Customer:

I am converting HTML to PDF using your software. When printing HTML using Internet Explorer, I can uncheck a box in the IE setting to not print background colors and images. Is there any way to specify that in your software?

Convert HTML to PDF with Background Colors and Images | VeryPDF Cloud API & PDF Tools


Reply from VeryPDF:

Yes, VeryPDF provides multiple solutions for converting HTML to PDF while allowing you to control background colors and images. Depending on which product you are using, the approach may vary. Below are the available options:

Using DocConverter COM for HTML to PDF Conversion

If you are using VeryPDF DocConverter COM, you can specify whether to include background colors and images by using the PrintHTMLBackground parameter.

Command-Line Examples:

To include background colors and images:

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

To exclude background colors and images:

html2pdf.exe "https://www.verypdf.com/" "C:/output.pdf" "PrintHTMLBackground=no"
Correcting Your Command Usage

You mentioned using the following command:

for %F in (D:\Distro\H2P\Alameda\Prod\*.*) do html2pdf.exe "%F" "D:\Distro\H2P\Alameda\Prod\%~nF.pdf" "papertype=0 , PrintHTMLBackground=no"

Your command is mostly correct, but note that there should be no space after the comma between parameters. The corrected version is:

for %F in (D:\Distro\H2P\Alameda\Prod\*.*) do html2pdf.exe "%F" "D:\Distro\H2P\Alameda\Prod\%~nF.pdf" "papertype=0,PrintHTMLBackground=no"

This ensures that the settings are applied correctly.


VeryPDF Cloud API - A More Powerful and Flexible Solution

For an even easier and more powerful way to convert HTML to PDF, we highly recommend using VeryPDF Cloud API Platform. This cloud-based solution allows you to convert HTML to PDF online without worrying about system configurations.

Advantages of VeryPDF Cloud API:

  • 100+ PDF Processing Functions: Convert, edit, encrypt, watermark, merge, split PDFs, and more.

  • No System Dependencies: Runs in the cloud, so you don’t need to install software or manage system configurations.

  • Easy Web Integration: Can be integrated into web applications with simple API calls.

  • High Performance & Scalability: Designed to handle large-scale document processing.

Example API Call for HTML to PDF Conversion:
Basic API Request:
curl -X POST "https://www.verypdf.com/api/html-to-pdf" \
     -d "url=https://www.verypdf.com/" \
     -d "output=output.pdf" \
     -d "PrintHTMLBackground=yes"
Where to Subscribe:

You can subscribe to the VeryPDF Cloud API Platform here: https://www.verypdf.com/online/cloud-api/index.html


Need Further Assistance?

For any further assistance, feel free to contact us at: http://support.verypdf.com/

Related Posts