Different results on different printers when printing CSS cm sizes









up vote
1
down vote

favorite
1












I am trying to print a box from a web page where the size is defined in cm - when I print to different printers I seem to get different results.



For example, I just printed an example on my home printer where I set it to print at 10cm wide and it printed at 10.5cm but on my work printer it prints at 8.5cm wide. All other settings are the same - same laptop, same browser (Safari on Mac) etc



A customer has tried the same thing this time on a PC running Firefox and Chrome and he also gets a smaller size than intended - in his case he wants the output to be 8.5cm x 5.5cm but it prints much smaller (top is Firefox, bottom is Chrome):



enter image description here



I don't have the exact sizes and apologies the image is so small (this is what we were sent) but it is clearly not printing to the card size.



The box I am trying to print is set using:



#id-card 
width: 10cm;
height: 6cm;
padding: 0;
margin: 0;
border: 1px solid black;



The border is added only so I can accurately measure the printed size - I realise it may cause a slight variance in the width but not to the extremes I am seeing.



Is there anything else which can influence the actual printed size?










share|improve this question





















  • Are you also taking into consideration the things outside of the #id-card, like the @page layout and html & body?
    – rawnewdlz
    Nov 9 at 22:21














up vote
1
down vote

favorite
1












I am trying to print a box from a web page where the size is defined in cm - when I print to different printers I seem to get different results.



For example, I just printed an example on my home printer where I set it to print at 10cm wide and it printed at 10.5cm but on my work printer it prints at 8.5cm wide. All other settings are the same - same laptop, same browser (Safari on Mac) etc



A customer has tried the same thing this time on a PC running Firefox and Chrome and he also gets a smaller size than intended - in his case he wants the output to be 8.5cm x 5.5cm but it prints much smaller (top is Firefox, bottom is Chrome):



enter image description here



I don't have the exact sizes and apologies the image is so small (this is what we were sent) but it is clearly not printing to the card size.



The box I am trying to print is set using:



#id-card 
width: 10cm;
height: 6cm;
padding: 0;
margin: 0;
border: 1px solid black;



The border is added only so I can accurately measure the printed size - I realise it may cause a slight variance in the width but not to the extremes I am seeing.



Is there anything else which can influence the actual printed size?










share|improve this question





















  • Are you also taking into consideration the things outside of the #id-card, like the @page layout and html & body?
    – rawnewdlz
    Nov 9 at 22:21












up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





I am trying to print a box from a web page where the size is defined in cm - when I print to different printers I seem to get different results.



For example, I just printed an example on my home printer where I set it to print at 10cm wide and it printed at 10.5cm but on my work printer it prints at 8.5cm wide. All other settings are the same - same laptop, same browser (Safari on Mac) etc



A customer has tried the same thing this time on a PC running Firefox and Chrome and he also gets a smaller size than intended - in his case he wants the output to be 8.5cm x 5.5cm but it prints much smaller (top is Firefox, bottom is Chrome):



enter image description here



I don't have the exact sizes and apologies the image is so small (this is what we were sent) but it is clearly not printing to the card size.



The box I am trying to print is set using:



#id-card 
width: 10cm;
height: 6cm;
padding: 0;
margin: 0;
border: 1px solid black;



The border is added only so I can accurately measure the printed size - I realise it may cause a slight variance in the width but not to the extremes I am seeing.



Is there anything else which can influence the actual printed size?










share|improve this question













I am trying to print a box from a web page where the size is defined in cm - when I print to different printers I seem to get different results.



For example, I just printed an example on my home printer where I set it to print at 10cm wide and it printed at 10.5cm but on my work printer it prints at 8.5cm wide. All other settings are the same - same laptop, same browser (Safari on Mac) etc



A customer has tried the same thing this time on a PC running Firefox and Chrome and he also gets a smaller size than intended - in his case he wants the output to be 8.5cm x 5.5cm but it prints much smaller (top is Firefox, bottom is Chrome):



enter image description here



I don't have the exact sizes and apologies the image is so small (this is what we were sent) but it is clearly not printing to the card size.



The box I am trying to print is set using:



#id-card 
width: 10cm;
height: 6cm;
padding: 0;
margin: 0;
border: 1px solid black;



The border is added only so I can accurately measure the printed size - I realise it may cause a slight variance in the width but not to the extremes I am seeing.



Is there anything else which can influence the actual printed size?







css printing






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 9 at 20:44









bhttoan

98931953




98931953











  • Are you also taking into consideration the things outside of the #id-card, like the @page layout and html & body?
    – rawnewdlz
    Nov 9 at 22:21
















  • Are you also taking into consideration the things outside of the #id-card, like the @page layout and html & body?
    – rawnewdlz
    Nov 9 at 22:21















Are you also taking into consideration the things outside of the #id-card, like the @page layout and html & body?
– rawnewdlz
Nov 9 at 22:21




Are you also taking into consideration the things outside of the #id-card, like the @page layout and html & body?
– rawnewdlz
Nov 9 at 22:21












1 Answer
1






active

oldest

votes

















up vote
0
down vote













Try setting the html and body to the expected print dimensions of the card. You did not share your HTML, so this is just an idea of how to control it.



@media print 
@page
size: 10cm 6cm;
margin: 0;
padding: 0;

html, body
width: 100mm;
height: 60mm;

#id-card
width: 10cm;
height: 6cm;
padding: 0;
margin: 0;
border: 1px solid black;







share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233025%2fdifferent-results-on-different-printers-when-printing-css-cm-sizes%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Try setting the html and body to the expected print dimensions of the card. You did not share your HTML, so this is just an idea of how to control it.



    @media print 
    @page
    size: 10cm 6cm;
    margin: 0;
    padding: 0;

    html, body
    width: 100mm;
    height: 60mm;

    #id-card
    width: 10cm;
    height: 6cm;
    padding: 0;
    margin: 0;
    border: 1px solid black;







    share|improve this answer
























      up vote
      0
      down vote













      Try setting the html and body to the expected print dimensions of the card. You did not share your HTML, so this is just an idea of how to control it.



      @media print 
      @page
      size: 10cm 6cm;
      margin: 0;
      padding: 0;

      html, body
      width: 100mm;
      height: 60mm;

      #id-card
      width: 10cm;
      height: 6cm;
      padding: 0;
      margin: 0;
      border: 1px solid black;







      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        Try setting the html and body to the expected print dimensions of the card. You did not share your HTML, so this is just an idea of how to control it.



        @media print 
        @page
        size: 10cm 6cm;
        margin: 0;
        padding: 0;

        html, body
        width: 100mm;
        height: 60mm;

        #id-card
        width: 10cm;
        height: 6cm;
        padding: 0;
        margin: 0;
        border: 1px solid black;







        share|improve this answer












        Try setting the html and body to the expected print dimensions of the card. You did not share your HTML, so this is just an idea of how to control it.



        @media print 
        @page
        size: 10cm 6cm;
        margin: 0;
        padding: 0;

        html, body
        width: 100mm;
        height: 60mm;

        #id-card
        width: 10cm;
        height: 6cm;
        padding: 0;
        margin: 0;
        border: 1px solid black;








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 9 at 22:32









        rawnewdlz

        544516




        544516



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233025%2fdifferent-results-on-different-printers-when-printing-css-cm-sizes%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Use pre created SQLite database for Android project in kotlin

            Darth Vader #20

            Ondo