Coder Social home page Coder Social logo

Comments (6)

jasonday avatar jasonday commented on August 18, 2024 1

Hi Dave,

it looks like you will need to add some specific css to handle this
scenario.

You can use the @page directive to remove the default print margins, in
addition to overriding any css margins/padding/alignment in your css.

 @page  {
    size: auto;   /* auto is the initial value */

    /* this affects the margin in the printer settings */
    margin: 25mm 25mm 25mm 25mm;  } /* try 0 */

 body  {
    /* this affects the margin on the content before sending to printer */
    margin: 0px;  }

Change the margin under @page and let me know how that works out.

-Jason

from printthis.

bigdavelamb avatar bigdavelamb commented on August 18, 2024

Hi Jason,

Thank you so much. That worked an absolute treat. Just for info, here is the output of the working image.

about_blank

Dave

from printthis.

bigdavelamb avatar bigdavelamb commented on August 18, 2024

Hi Jason,

I think I spoke to soon, I just tried it in IE and it looks the same as per the image in my first post. Can I check that my settings are correct:

    debug: false,           // show the iframe for debugging
    importCSS: false,        // import parent page css
    printContainer: false,   // print outer container/$.selector
    loadCSS: "/style/printbarcode.css",            // load an additional css file
    pageTitle: "",          // add title to print page
    removeInline: false     // remove all inline styles

Dave

from printthis.

bigdavelamb avatar bigdavelamb commented on August 18, 2024

Hi Jason,

Sorry to drive you mad. I just embedded my CSS directly in the page and set the importCSS to true and the margins do get set in IE, however I still get the Page1 of 1. So I must be somehow using the URL incorrectly in loadCSS ?

Dave

from printthis.

jasonday avatar jasonday commented on August 18, 2024

Dave,

try the full path - or embed the print styles into one of your other stylesheets.

Because the plugin creates an iframe, a relative path won't work correctly.

Thanks,

jason

from printthis.

bigdavelamb avatar bigdavelamb commented on August 18, 2024

Hi Jason, I fed in the css from my calling document (importCSS) which worked fine. For info I could not get the loadCSS to work.

Anyway thanks for the function and your assistance - all much appreciated.

Dave

from printthis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.