How to Decrease Paper Size

Asked

Viewed 362 times

-1

I am making a print with css print on the Bematech MP-4200 TH printer, my content is in a good size customized by css, however I would like to decrease the size of the paper because this leaving a very large space at the time.

I was seeing the configuration in Chrome and the size of the paper in the print this width 80mm.

There’s a way I can decrease the height of the paper in the print?

My css in print:

@media print {
    @page {          
        margin: 0;
    }

        html, body {
            width: 210mm;
            height: 100mm;
            margin:0px;
        }

        .pagina {
            margin: 0;
            border: initial;
            border-radius: initial;
            width: initial;
            min-height: initial;
            box-shadow: initial;
            background: initial;
            page-break-after: always;
        }

        /*body {
            background: #fff;
            width: 302px;
            height: 300px;
        }*/

        h2 {
            page-break-before: always;
        }

        h3, h4 {
            page-break-after: avoid;
        }

        pre, blockquote {
            page-break-inside: avoid;
        }

        .modal-dialog .modal-content {
            border: none;
        }

        .print {
            display: none;
        }

        #minhaTabela_wrapper {
            display: none;
        }

    #myModal {
        width: 110mm;
        height: 100mm;
        border: none;
        margin-left: 1px;
        margin-top: -15px;

    }

        #imprimir {
            margin-top: -30px;

        }   

    .text-print {
        float: left;
        font-size: 10px;
        font-family: Arial;

    }

    .input-print {
        border: none;
        font-family: Arial;
        font-size: 12px;
        width: 110px;
        float:left;
        margin-top: -11px;
    }

        .modal-header {
            border: none;
        }

        #codBarras {
            display: inline;
        }

        h4 {
            font-size: 10px;
        }

        .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_processing, .dataTables_wrapper .dataTables_paginate {
            display: none !important;
        }

    .larg {
        width:150px;
    }
    }
  • 1

    Cara takes a picture of how it is getting to impress~]ap and draws with a pen the sizes and where you want it to decrease, will be easier to understand what you are wanting... But usually paper formats have predefined sizes like A3, A4, A5, F1, F2, Letter, Legal, Tabloid, etc... surely your printer works...

  • @hugocsl edited and my question and put the photo, I will check which is the format of the paper.

  • 1

    Guy looks at the size of his body and html has 21cm x 10cm that size eh a A5 horizontal... Try changing this, or test by auto and put the size in @Page using the size property:

  • @hugocsl put on the body height: auto; but it was the same. Placing the property size on @Page I tried putting A3 which has 420 autura but only changed the content the page size is the same.

  • 1

    Dear I did this test, but note that the paper size does not change in Ctrl+P, only changes the size that the content will have at the time of printing. I set it to be 100mm by 120mm, but the printer sheet is still A4, because this is a config of the printer, not of the Browser... http://prntscr.com/lkskp6 note that you even gave more than a 1/2 sheet, but the printer page is A4 and I can’t change it to css

  • Got it, so is the printer configuration? Can I change ?

  • 2

    You can do a little more research, but I couldn’t solve it... the most I could do was to define how much content goes on the sheet and not the size of the sheet... Like, there will be content to fit on an A5 sheet, but if the printer is set to A4 paper it will print on A4 no matter what CSS... At least that’s what I got from the tests here, unfortunately... Read this may help: https://www.smashingmagazine.com/2015/01/designing-for-print-with-css/ and here https://www.smashingmagazine.com/2018/05/print-stylesheets-in-2018/

  • 1

    @hugocsl, Thank you so much for the help, the link you indicated on is show, I will check the printer configuration.Strong hug.

  • I have the same problem in my system that generates the printed one in a totally different way from yours. This is a problem of the printer known to the manufacturer Bematech. Neste link there are instructions on how to solve this problem.

Show 4 more comments

1 answer

0


The problem was in the printer, I downloaded the software from the manufacturer and reset the printer settings and solved the problem. Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.