Code Monkey home page Code Monkey logo

printthis's Introduction

#printThis Printing plug-in for jQuery

Features

  • Print specific & multiple DOM elements
  • Preserve page CSS/styling ** or add new CSS; the world is your oyster!
  • Preserve form entries

Non-features

really 'Issues'

  • canvas/svg elements such as map routes are not preserved

Usage

Basic

    $('selector').printThis();

Advanced

$('#kitty-one, #kitty-two, #kitty-three').printThis({
    importCSS: false,
    loadCSS: "",
    header: "<h1>Look at all of my kitties!</h1>"
});

All Options

    $("#mySelector").printThis({
        debug: false,               * show the iframe for debugging
        importCSS: true,            * import page CSS
        importStyle: false,         * import style tags
        printContainer: true,       * grab outer container as well as the contents of the selector
        loadCSS: "path/to/my.css",  * path to additional css file - us an array [] for multiple
        pageTitle: "",              * add title to print page
        removeInline: false,        * remove all inline styles from print elements
        printDelay: 333,            * variable print delay; depending on complexity a higher value may be necessary
        header: null,               * prefix to html
        formValues: true            * preserve input/form values
    });

Please read

  • "It's not working" without any details is not a valid issue and will be closed
  • A url, or html file, is neccessary to debug. Due to the complexities of printing and this plugin, an example is the best way to debug
  • When troubleshooting, set debug: true and inspect the iframe
  • Every user should be active in the debugging process

ToDo:

  • Look at more efficient form field value persist
  • Look at alternative to setTimeout ($.deferred?)

printthis's People

Contributors

jasonday avatar klarkc avatar caseyjhol avatar flashnet69 avatar alandmoore avatar relequestual avatar clavinmacario avatar idkn avatar 0x6368656174 avatar tanathos avatar

Watchers

James Cloos avatar Semdy Shu avatar

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.