magopian / att

ATTESTATION DE DÉPLACEMENT DÉROGATOIRE
https://magopian.github.io/att
33 stars 9 forks source link

Hide footer on print. #9

Closed Natim closed 4 years ago

Natim commented 4 years ago

r? @magopian

Natim commented 4 years ago

Do you know of a way to resize the canvas before print?

I tried

      // Resize canvas on print
      (function (oldPrint) { 
        window.print = function () {
          console.log("Redraw before print");
          canvas.width = 250;
          canvas.height = canvasWrapper.clientWidth * 0.5625;
          redraw();
          oldPrint();
        }
      })(window.print);

Without success so far.

magopian commented 4 years ago

I don't think you want to resize the canvas, it should be hidden in favor of the image that displays the signature once you "validated" it.

Natim commented 4 years ago

Note that exporting from the mobile works like that, it is when I export from the computer that I have two pages because the signature is too big.

magopian commented 4 years ago

Thanks a lot @Natim, can you please double check that my last modifications are working correctly for you, even on mobile?

Natim commented 4 years ago

Ok

Natim commented 4 years ago

image

I don't know if we can hide the date selector on print?

magopian commented 4 years ago

You mean https://stackoverflow.com/questions/52506410/hiding-a-clear-button-from-date-picker-on-print-in-firefox ? Seems it's not possible? :/

Natim commented 4 years ago

I tested it on mobile it works like a charm.

magopian commented 4 years ago

Thanks again for the work @Natim :+1: