bauhausjs / phantom-html2pdf

Node module to generate PDFs from HTML via PhantomJS
MIT License
112 stars 47 forks source link

Checkbox rendering wrong. #31

Closed ArtStepanyuk closed 8 years ago

ArtStepanyuk commented 8 years ago

Hello, I have this weird issue with checkbox rendering. http://imgur.com/3GIoHcV Trying to style checked state of the checkbox, but it doesn't work either, is there a way to fix this? Thank you.

dustin-H commented 8 years ago

Need more information:

ArtStepanyuk commented 8 years ago

I have some more information:

An issue exists on ubuntu machine and arch Linux, on windows 10 it renders just fine.

For testing purposes i use this html set up:

       <input type="checkbox" checked>Yes
       <input type="checkbox" checked>No 

There is no error message, template.pdf gets created without any error, and everything looks fine but checkboxes.

ArtStepanyuk commented 8 years ago

In case it may help someone this is my solution so far, far from being good but it gets job done.

    input[type=checkbox], input[type=radio] {
      -webkit-appearance: none;
      width: 9px;
      height: 9px;
      position: relative;
      top: 4px;
      background:
      url('data:image/png;base64,iVBORw0KGgoAAAANSUhE...) //image of unchecked checkbox
      no-repeat;
    }

    input[type=checkbox]:checked, input[type=radio]:checked {
      background:
      url('data:image/png;base64,iVBORw0KGgoAAAANSUhE...) //image of checked checkbox
      no-repeat;
    }

But would be nice to have fix for this out of box, thanks

dustin-H commented 8 years ago

First of all, thanks for more details.

However, since phantom-html2pdf is just a small lib using phantomJS this is not an issue of this repo. You should create a similar issue at the phantomjs repo.