Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8325025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:17:28+00:00 2026-06-09T00:17:28+00:00

I am currently converting a web page to a format that can be easily

  • 0

I am currently converting a web page to a format that can be easily printed to pdf while maintaining the same appearance. Many print to pdf tools do not allow you to print background images/colors so I am trying to get around that by putting a solid color image under the header elements of a table.
Right now it looks something like this:

<img src="/image.png" width="100%" style="margin-bottom:-90px">
<table><th>Header1</th><th>Header2</th>...

This looks as if the header elements have a solid colored background when I view it normally using a browser but when trying to print to a pdf the <th> elements have a blank white background over the image. Is there a way to force these elements to be viewed as transparent with the text against the image? Or maybe there is an easier way to work around the background issue?

Edit:
So my real problem here was that I was trying to make a work around to make the page accessible to as many htmltopdf tools as possible, ultimately this was just not an option as it will always look different in one browser or the other and one printer will force margins while the other won’t, etc. My solution to this was i created a simple app in php that printed the page using wkhtmltopdf, which I had to install on my server first. Once that was done the pdf looked good no matter the browser!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:17:30+00:00Added an answer on June 9, 2026 at 12:17 am

    When you “Print to PDF” a web page, the first responsibility lies with your browser to create the print job.

    And in this case they have to create a PostScript file for the job. (Only the next stage, when the virtual “PDF printer” comes into play, creates the PDF from this PostScript input. Unlike LibreOffice, OpenOffice and MS Office, browsers are not [yet] able to directly “Export to PDF”. Update: Apparently, Chrome does: as yms explains in a comment: open print dialog, use printer selection dropdown list to choose “Save as PDF”. However, I found that by default it does not print backgrounds.)

    Now you must consider two things:

    1. Most browsers do have settings, which allow for “print images”/”don’t print images” and “print background colors”/”don’t print background colors” and some such.

      So you should first ask yourself:

      • What are the settings of my browser for printing?

      • Is my browser handing over PostScript to the PDF printer which has the colors as I want them?

      If no, it’s not the PDF printer’s fault.

    2. As for the transparency features: PostScript does not support transparency (only PDF does). Therefor transparent areas need to be “flattened” for PostScript output (that is, transformed into bitmap images which try to mimic the look of transparent objects).

      However, not all applications and browsers are doing a good job when it comes to this “flattening”.

      As long as you need to “Print to PDF”, there is no chance in hell to get real transparency into the PDF file (you’ll only get the ‘mimikry’ bitmaps).

    Transparency here will only start to happen, once browsers start to be able to “Export to PDF”. Or you may find a third-party tool, which can directly convert from HTML to PDF (without using the print intermediate step that converts to a printable PostScript first).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently converting an old asp.net web forms page into a asp.net mvc version, and
I'm currently converting some legacy code to create PDF files using iTextSharp. We're creating
Currently working with converting SQLException error messages into messages that are more useful for
I have an application that I'm converting to Symfony/Doctrine. It currently stores a serialized
I am currently in the process of converting old Web 1.0 code to meet
I am converting some docs to pdf using wkhtmltopdf (currently using perl and the
I am currently working on an asp.net web page with a GridView displaying a
I am currently converting a Windows Phone 7 application to its web counterpart. The
I am currently working on converting an existing web application to support an additional
High Level Goal: Create a single Maven Web Application project that can be used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.