Illustrator margins and Safari idiocy

Dear Lazyweb,

At great personal irritation, I've learned some things about printer margins. I wasn't able to Google up this trivia or easily discern it from any documentation, so I will share it with you now.

Illustrator CS3:

When you create a new Letter-sized document in Illustrator CS3 and do Show Page Tiling, you'll see a dotted line showing margins ¼" from the left, top and right, and ½" from the bottom. These margins are advisory only: they are intended to show the part of the page that your printer can't actually print on. But your printer probably doesn't have such huge margins. In this modern world, 0.17" or so is more likely. So how do you change that?

First, you have to configure a printer! Even if you don't have a printer attached to the machine you're running Illustrator on, you have to pretend that you do. To fake it out, go to System Preferences / Print & Fax, click on the plus sign, select Line Printer Daemon; Address: localhost; Print Using: Select Printer Software... then pick a printer.

Now go into Illustrator's File / Print dialog and select that printer. In the page preview on the lower left, you'll now see margin outlines. Click Done.

These margin settings will be saved with your .ai file, and will show up even if you don't have a printer configured, but you can't change them without having a printer configured! So that's awesome.

Now, at this point, chances are you'll see that the margin outlines are in a nonsensical place like the left image below, with the margins lying off the left and top of the page. To reposition them to a sane orientation (the right image) you need to use the Page Tool, which is an option-click mode of the Hand Tool. It is well hidden and hard to use!

Having adjusted with the Hand Tool, you can go back to the Print dialog and save this as a preset, so that you don't have to do that every time you create a new document.

Again, these margins are only advisory, and don't affect the page origin. If you have ink 2" from the left edge of the document, it will show up 2" from the edge of the paper, regardless of the margins that are set in Illustrator. They're just like guides, I guess.

Safari 5.0.5:

Now here's where it gets really stupid.

On Safari's Print dialog, the Paper Size menu lets you create a custom paper size with custom margins, but don't bother, because it doesn't work. Safari completely ignores those margins at all times. Safari always prints with ¼" margins on left, top and right, and a ¾" margin on the bottom, no matter what printer you have selected, or what custom page size you have selected.

Unlike in Illustrator, those margins are not advisory. The top-leftmost ink on a page in Safari is printed inside those margins, at ¼" from the top and left edges of the page. Even if your printer can drop ink at 0.1" from the left edge, or at ½" from the bottom edge, there is no way to get Safari to render into that area, even if your CSS set the margin, padding and border on the "html" and "body" elements to 0. Safari treats those CSS measurements as starting inside the hardcoded printer margins.

Also: if your document is wider than 8" (on an 8½" page), Safari will proportionally scale your document to fit when printing. So if you've carefully specified in CSS that some page element should be exactly "1in" square, but your page happened to exceed the hardcoded 8", then your square will come out some random amount smaller.

For added inconsistency: if your document is taller than 10" (on an 11" page), it will just be truncated at exactly 10", not scaled.


Tags: , , ,

28 Responses:

  1. Jake Nelson says:

    This is why I essentially gave up on printers altogether. For me these days, things on screens and things on paper are completely separate, and ne'er the twain shall meet. Trying really hard to keep anything significant in the "screen" part these days, with increasing success.

    (Trying not to sound like those "I don't own a TV" people, though...)

    It just always seemed like one of the many cases of "let's make everything arbitrarily complicated", where many of the defenses seemed to rest on doing things in accordance with Ancient and Venerated ideas of how A Document Should Be Laid Out (possibly involving cast type), not that any actual legacy systems were being usably supported. Or in the case of margins, 1950s secretarial school textbooks and Miss Manners columns about how a Proper Business Letter should have so many lines between the address and the salutation, yada yada. (Word's default margins make a page effectively 6.5 x 8.5. Printing within sight of the edge is apparently barbarism.) Some days I wonder if the fundamentals have really been rethought at all since Pagemaker (which was a huge leap forward, but hardly a license to stop advancing)...

    As for scaling, always seemed to me the basic print options dialog should have two dropdowns: select a paper size and then choose from the printer-supported resolutions at that size. It renders like a screen of that resolution. (8.5x11 would normally get the typical set of 4:3 resolutions... 8.1x10.8 is 3:4 with non-terrible margins.)

    I expect if I brought this up to anyone involved with this stuff, I'd be told the same things I always am: "it already is that way! Sorta. Kinda. Except some implementations (i.e., all of them found in the real world) don't quite do it right. And there's all these complicated problems you didn't consider! Experts have been working on this forever!" So I haven't really thought about it much since I stopped having a job that involved dealing with printers and page formatting on a regular basis... except apparently I still had a wall of text waiting to be written on the subject. Hmm.

    • gryazi says:

      Printing within sight of the edge fucks up hole-punching and bindering later (though you need more like 1.25" on the left as a keepout for a standard US hole-punch, so hooray for defaults).

      Making printing work will forever remain a lot more boring and tedious and less profitable than selling iPads as a workaround.

      • Jake Nelson says:

        Hole-punching and bindering was largely solved by clear plastic pageholder thingies (for lack of a proper term) that one slides a normally-formatted page into, imho. Lot more durable than punched paper as well. Not free, but buy 'em by the myriad, and they're not too spendy, and reusable.

        Agreed on the second point. I've been hearing about SmartPaper (or whatever the current marketese for it is) for like a decade now, wish the vaporware would hurry up and condense into product already.

    • jwz says:

      You may intuit from the above that I don't actually have a printer at home at all. Paper is for chumps. But, I do sometimes have to print out signs to hang in my business, and I, sadly, have certain aesthetic requirements that rise just slightly above hand-written post-it notes, which is why I had to delve into this fucking arcana.

      We do twitter our drink specials, but you know, even in this modern world, that is just slightly insufficient.

      • Jake Nelson says:

        Once again, a desire for quality (even a bare minimum thereof) is the root of suffering. Sometimes I really envy the people who can just halfass everything and feel OK about it, without a semi-OCD impulse to fix it.

        Also, I can't help picturing you explaining this to someone and getting a response along the lines of "hey, I've got this great idea- just get some of those little digital picture frames...". The picture gets a little fuzzy after that point, what with all the blood. (Even more tangentially: I noticed at work the other day that those things have approximately halved in price recently. I wonder if everyone else finally noticed that a 10" digital picture frame cost more than the netbook with a 10" screen two aisles over. Price is still too high, but it's getting there.)

  2. Sam says:

    When working in Illustrator, we would always choose some gargantuan page size (24x36, etc) and use that as the default print size centered on the page.

    Then, save as a PDF and print from that (need to delete all hidden layers first). Not because adding in extra steps is fun, it is just more predictable to print from a flat PDF.

    Go Adobe. I don't think they have a single app that does not require some form of stupid work around for basic functionality.

  3. Breton says:

    If you're trying to use HTML and CSS to create print documents, the best way to go is using Prince XML , which, actually corrects most of these printing stupidities you get in most browsers, and lets you produce clean PDF or PS files from your html/css stuff.

    HOWEVER, depending on what you're actually doing, that may have nothing at all to do with what you need. In which case, sorry.

  4. You seem to have a dysfunctional relationship with computers. Have you ever considered seeing a therapist about it?

    • Chan Secodina says:

      I always thought he might be happier just dropping out of the industry all together and opening a nightclub or a pizza joint or something.

  5. Editer says:

    I confess it would not have occurred to me to use web authoring tools to produce a print document. What advantages (besides "not being Illustrator") do HTML and CSS provide in that medium?

    • jwz says:

      It's a lot easier to teach people how to type text into a form on a web page than to teach them how to lay out text in Illustrator.

      • Editer says:

        Ah, the interactivity factor. I see. Thanks.

      • Jerub says:

        If that's all you're after, you might give this open source, python, tool a shot: . It doesn't really take xhtml as it's input, it's closer to 'html with lots of print css implemented'. I've used it to create booklets, invoices, manuals and even name badges (each name badge was a different frame on the page, absolute positioned).

        Ideally, get the CSS right, drop what the user types into the web form into a .html file, run this script, open the resulting pdf, then hit print.

  6. Breton says:

    Alternatively, Postscript is actually not that hard a language to learn, or generate via script, even client side. I've got a demo here it's a very small program. You can pick up what's going on easily.

    • Breton says:

      Be forewarned though, I haven't set the slider ranges to anything sane :/

    • Breton says:

      And I should save you some cognitive load here I suppose. I use a script tag with a non javascript type to just store some postscript text. I've templated the postscript text using {} curly braces, and use the supplant method to inject my parameters into the postscript text. I then simply encode the whole thing into a data: uri, and stick it into the href of the eps link. tadah. For your purposes, you could generate an EPS out of illustrator, and just find the spot where the text is, and template it from there. You wouldn't even necessarily need the intricacies of EPS, unless you want to do something fancy like.. I dunno, word wrapping.

    • Phil says:

      You're new here, aren't you?

      • Breton says:

        Not *that* new. I just forgot about those. And at the very least, hopefully I've contributed something useful here, today, by just pointing out how easy it is to template a PS file with an HTML form.

        • jwz says:

          I hadn't thought of templatizing PS or PDF that way, it's a neat idea. It does make word-wrapping impossible, though, so it won't work for what I'm doing.

          • Ewen McNeill says:

            If you are sufficiently determined, it is possible to implement word wrapping in Postscript, including allowing for non-fixed-pitch fonts and kerning. Just saying.*


            * Having actually done this, I do not recommend attempting to do so. The mucking with margins you describe is much simpler. (That said, templated Postscript is a useful approach, and the language is Turing Complete. IIRC there are several word-wrap Postscript routines out there a web search away; I just recall all of them needing tweaking for my use case. YMMV. FWIW, my approach of 15 years to "higher level" page layout problems has been to generate TeX (or LaTeX files) and process those through to ink-on-paper; the printing layout is more predictable than HTML/CSS.)

  7. Breton says:

    if you go the illustrator route for generating your template though, try and save in the lowest version of EPS possible, and delete all the symbols from the symbol palette. Also try not to kern anything, as illustrator actually generates seperate text commands for each "segment" of the kern.
    *sigh*. Well it's worth a think anyway.

  8. Lloyd says:

    While we're discussing how badly browsers understand printers, may I draw to your attention Firefox bug 311338, wherein the concepts of representing landscape and portrait are confused in Firefox 1, 2, 3 and 4.

    I believe it's unfair for jamie to criticise a browser that he didn't have a hand in creating.

    • Breton says:

      None of the browsers handle printing well. In the great browser race, print CSS, aural css, mobile css, and media queries have been sadly neglected. Someone needs to make an Acid Print test.

  9. Breton says:

    Oohhh ohh I just thought of something. You've done some canvas coding for the webos version of daliclock. The canvas API is just a wholesale ripoff of the postscript drawing api, so you'll feel right at home there at least.

  10. Joe Thompson says:

    This vaguely reminds me of the issues I had getting things to line up exactly right in XeLaTeX -- apparently you are not allowed to have paragraphs line up precisely. I had to redo the whole doc as a table and of course then it all lined up exactly right in the obvious way that it refused to when formatted as a set of paragraphs.