Results 1 to 3 of 3

Thread: What happened to using a fixed width font when printing e-mails?

  1. #1
    thunder04 is offline Special Member
    Join Date
    Dec 2007
    Location
    At work...Menlo Park, CA
    Posts
    155
    Rep Power
    7

    Default What happened to using a fixed width font when printing e-mails?

    Hey all,

    Ever since we upgraded from 5.0.18 to 6.0.4 I've received several complaints about printing e-mails. With the 5.0.x version of Zimbra, the print version of an email was generated using a fixed width font (Courier or similar) which enabled plain text e-mails to retain their formatting.

    Now, in 6.0.4, the print version of a plain text e-mail seems to become HTML formatted (to enable the ability to change the font size, I assume) which totally destroys the formatting of plain text e-mails.

    Is there any way to fix this?

    Thanks!

  2. #2
    worraps is offline New Member
    Join Date
    Jun 2012
    Posts
    3
    Rep Power
    2

    Default Print a message in fixed-width font. HACK/Work Around

    I imagine this is still a problem in 7.2.0 using webmail, but it is or almost the same problem in ZD 7.1.4

    We forward old green-bar reports for a UNIX system to our email as a text only formatted email. When viewing it in the ZD window it looks fine. (still fixed-width). However, as soon as you click the print icon, the new print preview window reverts to HTML and forces the font of the body.

    What should happen is that if, the message is in the format of "Text" as opposed to "HTML", then the preview window should also use a fixed-font. Of course this should be specified somewhere in preferences so you can specify a font size also.

    This work-around does the following:

    • Prompt the user EVERY time they select the print icon whether or not to print in HTML (Yes, this an inconvenience for normal printing, but minor for the ability to read your fixed-width reports on paper).
    • Modify the DOM on-the-fly to set the body of the message to "Courier New"


    You will, of course have to pick a font supported by your users system. I originally tried "Courier" but I got the gibberish other people have mentioned in other threads. The font "Fixedsys" may also work.


    The work-around can be addressed in the following file on Windows ( I am sure the path is similar for other OS's)

    C:\Program Files\Zimbra\Zimbra Desktop\jetty\webapps\zimbra\h\printmessage

    The bottom of the file reads...
    Code:
    <script type="text/javascript">
    <!--
    				 setTimeout('window.print()', 1000);
    //-->
    </script>
    </body>
    </html>
    Inserting the following lines above the line containing "setTimeOut"...
    Code:
    <script type="text/javascript">
    <!--
    
    				if(!confirm('Click OK to print as HTML or click Cancel to print as plain text.')){
    					e=document.getElementById('iframeBody');
    					e.style.fontFamily='Courier New';
    				}
    				 setTimeout('window.print()', 1000);
    //-->
    </script>
    </body>
    </html>

    I hope this isn't a no-no to post... but it works for me.

    I haven't actually tried this on my server, but on my local machine instance of ZD. The end result should be the same if you change the server file. Just be aware that the font name you pick must work for any client... so I suggest a comma delimited list of fixed-width fonts that would work on Windows/Linux/Mac as a default installed font. Maybe someone with this experience could post a list.

    If there is enough interest I could look into building a quick zimlet to allow for this if I can access the print message functionality, but it should be a fixed as a bug.

    Todd
    Last edited by worraps; 06-27-2012 at 12:09 PM.

  3. #3
    Crayz9000 is offline Senior Member
    Join Date
    Feb 2012
    Location
    Las Vegas
    Posts
    65
    Rep Power
    3

    Default

    Actually, the standard, cross-platform way to force a monospace font is to simply specify "Monospace" as the font. The browser will automatically choose the system default monospaced font (on Windows, that may be Courier New; on Macs, it's either Monaco or Menlo, and in Linux, it could be just about anything but usually something Deja Sans Mono, Droid Sans Mono, Liberation Mono, Nimbus Mono L, Ubuntu Mono, etc.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 05-25-2009, 09:05 AM
  2. Replies: 5
    Last Post: 06-18-2008, 01:50 AM
  3. "NO APPEND failed" message when migrating mails
    By tkrag@mostlyharmless.dk in forum Administrators
    Replies: 8
    Last Post: 05-18-2007, 06:25 AM
  4. Confusion on Bugs Fixed in New Release
    By soxfan in forum Administrators
    Replies: 6
    Last Post: 03-30-2007, 01:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •