6.0.0-git
2019-04-25

[#8708] HTML messages in IFRAME don't print correctly
Summary HTML messages in IFRAME don't print correctly
Queue IMP
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners
Requester slusarz (at) horde (dot) org
Created 2009-11-13 (3450 days ago)
Due
Updated 2010-02-06 (3365 days ago)
Assigned 2010-01-21 (3381 days ago)
Resolved 2010-02-03 (3368 days ago)
Milestone 5
Patch No

History
2010-02-06 06:13:38 CVS Commit Comment #14 Reply to this comment
Changes have been made in Git for this ticket:

Remove global IMP print links and replace with part printing
Resolves Ticket #8708.

http://git.horde.org/diff.php/framework/Core/lib/Horde.php?rt=horde-git&r1=e73c134898000aa83c9b5fbf815e9829adcbbd3e&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/horde/js/popup.js?rt=horde-git&r1=44794778d1e148b988fe57a75b3ef203883fa05f&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/config/conf.xml?rt=horde-git&r1=cde8827eafea3e0308c342936f55a896975566ad&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/js/DimpCore.js?rt=horde-git&r1=9ee8792713615381635a97a51a467dc688c5d269&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/js/imp.js?rt=horde-git&r1=01724aed550a214b375483088cda6f21608b9265&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/js/message.js?rt=horde-git&r1=99e7aaf59cae56bbdbbfe3256ce8d4564f547e49&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/lib/Contents.php?rt=horde-git&r1=7f11545142f8b9959af8ae4bc0f0c3257d6f966b&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/lib/Views/ShowMessage.php?rt=horde-git&r1=1a310b2de34193b3f984e4506d87b32de412a65e&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/message-dimp.php?rt=horde-git&r1=6aa09cca98cc3fa3591a1607480225dc83086469&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/message.php?rt=horde-git&r1=e73c134898000aa83c9b5fbf815e9829adcbbd3e&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/templates/chunks/message.php?rt=horde-git&r1=9ad763efa473b2301c7280cc0d6d8ed8eae2fe24&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/templates/index/index-dimp.inc?rt=horde-git&r1=12e455a324a5a44ca84c3d8939d50484eb9d9ad8&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/templates/message/navbar_actions.html?rt=horde-git&r1=9ad763efa473b2301c7280cc0d6d8ed8eae2fe24&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/themes/screen-dimp.css?rt=horde-git&r1=9ad763efa473b2301c7280cc0d6d8ed8eae2fe24&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/themes/screen.css?rt=horde-git&r1=41e79b3ecbd42ca346a7a69e69a3c721b5583389&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/themes/silver/screen-dimp.css?rt=horde-git&r1=9ad763efa473b2301c7280cc0d6d8ed8eae2fe24&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/themes/silver/screen.css?rt=horde-git&r1=99e7aaf59cae56bbdbbfe3256ce8d4564f547e49&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
2010-02-04 02:14:56 Chuck Hagenbuch Comment #13 Reply to this comment
Thanks for taking the time to sort this out.
2010-02-03 21:51:39 Michael Slusarz Comment #12
State ⇒ Resolved
Reply to this comment
It may be possible to parse our CSS, extract just the rules needed, 
and then hardcode the styles in the header part.  But this is not 
trivial either.  And not something I'm willing to devote a large 
amount of time to.
So... this wasn't trivial, but it was doable with several hours of 
work.  And printing messages correctly is such an integral feature 
(IMHO) that this needs to be handled properly.

I have merged the code to master.  Since this is implemented, closing 
this bug.  Error reports should be in new bugs.
2010-02-03 21:43:33 CVS Commit Comment #9 Reply to this comment
Changes have been made in Git for this ticket:

Remove global IMP print links and replace with part printing
Resolves Ticket #8708.

http://git.horde.org/diff.php/framework/Core/lib/Horde.php?rt=horde-git&r1=e73c134898000aa83c9b5fbf815e9829adcbbd3e&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/horde/js/popup.js?rt=horde-git&r1=44794778d1e148b988fe57a75b3ef203883fa05f&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/config/conf.xml?rt=horde-git&r1=cde8827eafea3e0308c342936f55a896975566ad&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/js/DimpCore.js?rt=horde-git&r1=9ee8792713615381635a97a51a467dc688c5d269&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/js/imp.js?rt=horde-git&r1=01724aed550a214b375483088cda6f21608b9265&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/js/message.js?rt=horde-git&r1=99e7aaf59cae56bbdbbfe3256ce8d4564f547e49&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/lib/Contents.php?rt=horde-git&r1=7f11545142f8b9959af8ae4bc0f0c3257d6f966b&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/lib/Views/ShowMessage.php?rt=horde-git&r1=1a310b2de34193b3f984e4506d87b32de412a65e&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/message-dimp.php?rt=horde-git&r1=6aa09cca98cc3fa3591a1607480225dc83086469&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/message.php?rt=horde-git&r1=e73c134898000aa83c9b5fbf815e9829adcbbd3e&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/templates/chunks/message.php?rt=horde-git&r1=9ad763efa473b2301c7280cc0d6d8ed8eae2fe24&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/templates/index/index-dimp.inc?rt=horde-git&r1=12e455a324a5a44ca84c3d8939d50484eb9d9ad8&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/templates/message/navbar_actions.html?rt=horde-git&r1=9ad763efa473b2301c7280cc0d6d8ed8eae2fe24&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/themes/screen-dimp.css?rt=horde-git&r1=9ad763efa473b2301c7280cc0d6d8ed8eae2fe24&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/themes/screen.css?rt=horde-git&r1=41e79b3ecbd42ca346a7a69e69a3c721b5583389&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/themes/silver/screen-dimp.css?rt=horde-git&r1=9ad763efa473b2301c7280cc0d6d8ed8eae2fe24&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
http://git.horde.org/diff.php/imp/themes/silver/screen.css?rt=horde-git&r1=99e7aaf59cae56bbdbbfe3256ce8d4564f547e49&r2=f7ff14c920be92809d72c7298bba4aabbea15c22
2010-02-02 16:50:16 Michael Slusarz Comment #8 Reply to this comment
I readily admit I might be missing something here. Would it be 
possible to read in the relevant CSS files and stream them out as 
part of the page, instead of hardcoding as such?
No.  It's not an issue with inserting them in the page; this can be 
done easily enough (?) with a preg_replace().  Instead, we go through 
all this trouble to create an environment where HTML can be rendered 
exactly how it is intended by the sender, and then we go introduce CSS 
that will surely affect the page layout (since we have several rules 
that are guaranteed to work on the entire document).

It may be possible to parse our CSS, extract just the rules needed, 
and then hardcode the styles in the header part.  But this is not 
trivial either.  And not something I'm willing to devote a large 
amount of time to.
2010-02-02 03:52:20 Chuck Hagenbuch Comment #7 Reply to this comment
With my latest commits - I have fixed this for all browsers except 
for Mozilla.  In Mozilla, only the part content is printed.  It 
would be possible to add header information directly to the output 
by manually inserting the HTML code for the headers into the content 
output.  However, this would require hardcoding of the CSS into the 
application code and I know some have objected to this approach in 
the past.
I readily admit I might be missing something here. Would it be 
possible to read in the relevant CSS files and stream them out as part 
of the page, instead of hardcoding as such?
2010-02-01 19:47:11 Michael Slusarz Comment #6 Reply to this comment
- Can't print an 'archive' type e-mail - i.e. an email that contains 
the header information along with the part data.
With my latest commits - I have fixed this for all browsers except for 
Mozilla.  In Mozilla, only the part content is printed.  It would be 
possible to add header information directly to the output by manually 
inserting the HTML code for the headers into the content output.   
However, this would require hardcoding of the CSS into the application 
code and I know some have objected to this approach in the past.
2010-01-26 23:06:31 Jan Schneider Comment #5 Reply to this comment
I tried that but didn't see a difference. This was with an attached 
message/rfc822 attachment, i.e. with a forwarded message.
2010-01-21 23:20:06 Michael Slusarz Comment #4
State ⇒ Feedback
Reply to this comment
I have created a git branch - impprint - in which I have removed all 
message-wide print functions in IMP and replaced them with print links 
to each individual part.

+ Solves the topic of this bug report :)
+ Most of the time, the content of an individual part is the only 
thing you want (i.e. printing an HTML-formatted receipt)

- Can't print an 'archive' type e-mail - i.e. an email that contains 
the header information along with the part data.

Feedback would be appreciated.
2009-11-18 21:37:29 Jan Schneider Comment #3 Reply to this comment
I just checked Gmail and Hotmail, and that's what both do. They both 
suffer from the same Firefox bug, and they both show a print icon/link 
that opens a new window that triggers window.print(). And they do this 
for any message, not only for HTML messages.
2009-11-18 19:18:03 Michael Slusarz Comment #2 Reply to this comment
The best I can come up with:
Show print link for all messages.  For messages with HTML parts, on 
Firefox, hide the print link.  To print individual parts, they can 
open the part in a popup window and then print using the browser button.

Possibly add print icons to the mime info header for inline parts when 
the print link is disabled.  This print link can open the popup view 
window as normal, with the addition that onload code will call 
'window.print()' when the popup view is finished loading.  But this 
still leaves the issue of not allowing (on FF) printing of a message 
with mail headers for any mail message that contains inline viewable 
HTML parts.
2009-11-13 18:08:35 Michael Slusarz Comment #1
Type ⇒ Bug
State ⇒ Assigned
Priority ⇒ 2. Medium
Summary ⇒ HTML messages in IFRAME don't print correctly
Queue ⇒ IMP
Milestone ⇒ 5
Patch ⇒ No
Reply to this comment
IFRAME content does not print correctly, at least on Firefox.  The 
open bug (since 2001!):
https://bugzilla.mozilla.org/show_bug.cgi?id=113217

This pretty much destroys any chance of being able to print messages 
from within an IMP/DIMP page short of opening a new window which will 
display the HTML code not in an IFRAME.

Saved Queries