• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS Set printer settings to print label

AdyUPL

New Coder
Hi,
Where i have mistake?
I try set print friendly page to print label.

It's work when i edit printer settings before print.
How i can set this from this page?


HTML:
<style type="text/css">
body {
    margin: 0;
    padding: 0;
    background-color: #FAFAFA;
    font: 8pt "Arial";
    font-weight:bold;
    text-align: center;
}
@page {
    margin: 0mm;
    size: 50mm 30mm portrait;
}

* {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
}
.page {
    margin: auto;
    border: 1px #D3D3D3 solid;
    border-radius: 5px;
    background: white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);

}
@media print {
    .page {
        margin: auto;
        border: none;
        border-radius: none;
        box-shadow: none;
        background: initial;
        page-break-after: always;
    }
}

#img{
    transform:scale(0.6,0.6) translate(-20%,-3px);;
}
</style>
<div style="max-width: 50mm;max-height: 30mm;">
<div class="page">
Data przyjęcia: {{{value DataPrzyj}}}<br>
Nr: {{{value NrInw}}}<br>
{{{value Nazwa}}}
<div id="img">{{{value KodKres2}}}</div>
{{{value KodKres}}}
</div>
</div>
 

Attachments

  • Printer setting.png
    Printer setting.png
    39.2 KB · Views: 5
  • Label.png
    Label.png
    4.1 KB · Views: 5
Top