Print.js / Lukas WinklerPrins
I returned to the patterns that many people had been making for this class—my kinetic patterns, Daniel's stock element creations, John's repeats, Catherine's typographic layerings. I went about trying to print these. "print.js" is a file that, in theory, you can simply put into the end of your head tag and it will create an @media print{} style sheet that translates your screen output into something printable. With it, one can easily specify paper output size that crops the pattern before printing.

There are some best practices for formatting:
1. All javascript must be in the head or external file. None in the body. Use jquery!
2. Put print.js at the very end of your head.
3. The outside div should be called either “wrapper” or “container,” otherwise it will assume it is a structural div rather than big wrapper.
4. Structure goes body > “wrapper” > container divs > pattern divs.
5. Write your CSS in a tag rather than on a separate .css file.
6. Requires a tag at beginning, to find page height.

Below is the javascript. At top, you input paper width and length, and the unit you used. You can also view the source here.

To install, simply save the above in your directory as “print.js”. Then, put the following two lines into your html page:

print.js works best in SafariThis is because Google Chrome has limited built-in paper size options and Firefox applies obnoxious user agent styles..


More Code