php 身份证印刷85.60mm X 53.98mm

t2a7ltrp  于 2022-10-30  发布在  PHP
关注(0)|答案(1)|浏览(137)

我正在设置一个身份证打印软件在PHP的横向和纵向模式。问题是与print()命令,它总是采取标准的页面大小A4,A3...因为这一点,它打印的身份证在一个特定的部分卡。
有没有人能帮助或推荐一些东西?也许有另一种方法可以在chrome中不使用打印预览来打印?

<style>
        @page {
          /*size: A5;
          margin: 5px;*/
          width: 53.98mm;
          height: 85.60mm;
          margin: 0px;
        }
        @media print {
          html, body {
            /*width: 210mm;
            height: 297mm;*/
            /*width: 218mm;
            height: 340mm;*/
          }
        }
        #printablediv {
          width: 53.98mm;
          height: 85.60mm;
        }
        .idcardreport {
            font-family: arial;    
             -webkit-print-color-adjust: exact;
        }
        /*IDcard Front Part Css Code*/
        .idcardreport-frontend{
            margin: 2px;
            float: left;
            border: 1px solid #000;
            padding: 10px;
            width: 260px;
            text-align: center;
            height:370px;
            background-size: 100% 100% !important;
        }

        .logo img{
            width: 50px;
            height: 50px;
            border: 1px solid #ddd;
            margin-bottom: 5px;
        }

        .pick img{
            width: 60px;
            height: 80px;
            border: 1px solid #ddd;
            margin-bottom: 5px;
        }

        .signe img{
            width: 50px;
            height: 50px;
            border: 1px solid #ddd;
            margin-bottom: 5px;
        }

        h3 {
            font-size: 14px;
            color: #1A2229;
            text-align: center;
        }
        h2 {
            font-size: 10px;
            color: #1A2229;
            text-align: center;
        }
        h1 {
            font-size: 18px;
            color: #1A2229;
            text-align: center;
        }
        p {
            text-align: left;
            font-size: 12px;
            margin-bottom: 0px;
            margin-top: 1px;
            color: #1A2229;
        }
        .vertical{
            writing-mode:tb-rl;
            -webkit-transform:rotate(180deg);
            -moz-transform:rotate(180deg);
            -o-transform: rotate(180deg);
            -ms-transform:rotate(180deg);
            transform: rotate(180deg);
            white-space:nowrap;
            display:block;
            bottom:0;

        }
    </style>
4zcjmb1e

4zcjmb1e1#

<style>
    @media print {
      body * {
        visibility: hidden;
      }
      #section-to-print, #section-to-print * {
        visibility: visible;
      }
      #section-to-print {
        position: absolute;
        left: 0px;
        /*right: -400px;*/
        top: 0;
      }
    }
    button.btn.btn-dark {
        padding: 10px;
        position: relative;
        top: -390px;
    }
</style>

<button type="button" class="btn btn-dark" onclick="window.print()"><i class="fa fa-print"></i> Print</button>

<div class="wrapper" id="section-to-print"></div>  //add ID on the section u want to print

相关问题