Solution for printing an HTML5 topic from IE8?

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
candeeh
Propeller Head
Posts: 16
Joined: Mon Apr 23, 2012 12:21 pm

Solution for printing an HTML5 topic from IE8?

Post by candeeh »

Does anyone have a solution for printing an entire topic (not just what is visible in the browser window) when using IE8 to view HTML5 output? I have looked all over this forum and did not see any solutions, so I am hoping that someone has already implemented a solution, maybe using some JavaScript? Any help is greatly appreciated! I HATE IE :evil: - I wish our customers would use Chrome, Firefox, or any of the other browsers!
Candee Hellberg
Sr. Communications Analyst
LexisNexis
Raleigh, North Carolina, United States
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Solution for printing an HTML5 topic from IE8?

Post by doc_guy »

That is a HUGE bug. Have you logged it with MC?

The content is in an iFrame, so I wonder if you could create a button that would identify the iFrame by name and print the contents of that frame. Here is the code that calls the iFrame:

Code: Select all

<iframe id="topic" name="topic" frameBorder="0"></iframe>
Since the ID of the iframe is always the same, it seems you could use JavaScript to make this work.

GAAHHH! I hate FRAMES!!
Paul Pehrson
My Blog

Image
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: Solution for printing an HTML5 topic from IE8?

Post by crdmerge »

Well, I'm confused! A Print Preview in Firefox gives me the same result (Contents/Index pane and the topic) as does IE8. What am I supposed to hate now? :lol:
candeeh
Propeller Head
Posts: 16
Joined: Mon Apr 23, 2012 12:21 pm

Re: Solution for printing an HTML5 topic from IE8?

Post by candeeh »

One of my co-workers was going to contact MC about this, but I have a feeling it is IE because I just downloaded IE9 and I still get the same results, regardless if I am using Print Preview or actually printing the topic. I was not aware that Print Preview in Firefox gave the same results. I guess Chrome is the only browser right now that fully supports printing the contents of an iframe. I am only a newbie when it comes to JavaScript, so I am not exactly sure how to code in JS to get the iframe contents to print. I guess I will have to do some researching on that, unless someone has already created that code and is willing to share it! :wink:
Candee Hellberg
Sr. Communications Analyst
LexisNexis
Raleigh, North Carolina, United States
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Solution for printing an HTML5 topic from IE8?

Post by NorthEast »

doc_guy wrote:I wonder if you could create a button that would identify the iFrame by name and print the contents of that frame.
This works for me in IE9 (not tested others); it prints the topic frame, and not the whole page.

Add a toolbar button, and insert this code as the button Event:

Code: Select all

topic.focus(); topic.print();
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Solution for printing an HTML5 topic from IE8?

Post by RamonS »

doc_guy wrote:GAAHHH! I hate FRAMES!!
Why? Frames are there for a reason and they are perfectly valid even under HTML5. Sure, they are not without disadvantages, but everything in HTML has disadvantages, although for the most part those come from the moronic implementation in the various browsers.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Solution for printing an HTML5 topic from IE8?

Post by LTinker68 »

crdmerge wrote:Well, I'm confused! A Print Preview in Firefox gives me the same result (Contents/Index pane and the topic) as does IE8. What am I supposed to hate now? :lol:
It might depend on what part of the window is active at the time you try to print a topic. For example, when you open the help the focus might be on the whole help in the browser window. When you go to a topic and scroll up or down or put your cursor in the topic to expand a toggle or something, then the focus would be in that iFrame. If you print at that point, you might just get what you're expecting.

I've been away from Flare for awhile and stopped working on HTML5 because it's not ready for production, IMHO, so I don't remember if I noticed any difference about printing, depending on what had the focus at the time I tried to print, but it's something you might want to try on your end to see if it is focus-dependent.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: Solution for printing an HTML5 topic from IE8?

Post by crdmerge »

No, Lisa, I specifically enforced focus in the topic page for my testing. And yes, the Flare implementation of HTML5 is seriously not ready for prime time, even worse for merged projects.

Sigh...


Leon
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Solution for printing an HTML5 topic from IE8?

Post by NorthEast »

crdmerge wrote:No, Lisa, I specifically enforced focus in the topic page for my testing. And yes, the Flare implementation of HTML5 is seriously not ready for prime time, even worse for merged projects.

Sigh...


Leon
That isn't to do with Flare's HTML5 output, it's just how Firefox works.
Print preview in Firefox only works for the full page; to print a frame you need to right-click the frame and select This Frame > Print Frame. (There isn't a preview though.)

The original issue raised by candeeh is about how the topic prints when you use the the HTML5 toolbar icon (which I think my post above should fix).
candeeh
Propeller Head
Posts: 16
Joined: Mon Apr 23, 2012 12:21 pm

Re: Solution for printing an HTML5 topic from IE8?

Post by candeeh »

Dave Lee: Your tip on adding a new toolbar button and assigning the topic.focus(); topic.print(); event worked great! Thank you so much!

Side note: I do not know if it works in IE8, because after frustration set in yesterday, I downloaded and installed IE9 and it overwrote my IE8 install, so I cannot test this on IE8. However, chances are, it will probably work, since I was getting the same results from IE9 that I had gotten from IE8.

I wonder why MadCap just didn't put this into their code for the Print button, since it appears works perfectly in both Firefox and IE9. I am going to test it on Chrome, once I get that installed, but my guess is that it will work in Chrome too. So again, why was this not coded into Flare? Just my two cents!

Thanks again Dave - you saved me from going bald! :D

Candee
Candee Hellberg
Sr. Communications Analyst
LexisNexis
Raleigh, North Carolina, United States
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Solution for printing an HTML5 topic from IE8?

Post by doc_guy »

RamonS wrote:
doc_guy wrote:GAAHHH! I hate FRAMES!!
Why? Frames are there for a reason and they are perfectly valid even under HTML5. Sure, they are not without disadvantages, but everything in HTML has disadvantages, although for the most part those come from the moronic implementation in the various browsers.
Frames are valid, just as tables are valid, but that doesn't mean you should necessarily use tables to design the site's style. In this case, it feels like using an iFrame is a lazy way around loading the content into a div and using Ajax calls to replace the content of the div. An iFrame is notoriously difficult for end-users to interact with, especially if people are using mobile browsers to access the content. (Yes, I know you can create a mobile help output, but even better would be a single, responsive layout that worked for small screens and large screens alike.)

Frames make it more difficult to print, more difficult to find the source HTML of the page, more difficult to QA, etc. Do they have a place? Yes. Would the "HTML5" output have been better without them? I argue yes. A real "modern" solution would be a responsive layout with Ajax calls to replace the topic div when needed. THAT would be a sweet output.

For those who don't understand what I mean by "responsive design", here is a Wikipedia entry on the topic.
Paul Pehrson
My Blog

Image
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Solution for printing an HTML5 topic from IE8?

Post by doc_guy »

candeeh wrote:Dave Lee: Your tip on adding a new toolbar button and assigning the topic.focus(); topic.print(); event worked great! Thank you so much!
Works for me in Firefox, but not in Chrome. In Chrome the button does nothing.
Paul Pehrson
My Blog

Image
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Solution for printing an HTML5 topic from IE8?

Post by RamonS »

I just wonder if it then works similarly enough in all common browsers. Also, Ajax calls means more client side JavaScript, which is notoriously slow. Although I don't see a way around it in general. My objection was more that I got the impression as if you think iframes are not valid HTML5.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Solution for printing an HTML5 topic from IE8?

Post by doc_guy »

RamonS wrote:I just wonder if it then works similarly enough in all common browsers. Also, Ajax calls means more client side JavaScript, which is notoriously slow. Although I don't see a way around it in general. My objection was more that I got the impression as if you think iframes are not valid HTML5.
Ah. I get it. Yeah, I'm aware that they are supported in HTML5. I was just disappointing to find them in "HTML5" output from Flare. :)
Paul Pehrson
My Blog

Image
candeeh
Propeller Head
Posts: 16
Joined: Mon Apr 23, 2012 12:21 pm

Re: Solution for printing an HTML5 topic from IE8?

Post by candeeh »

Doc_Guy

If this does not work in Chrome, then we can't use it because quite a few of our customers use the Chrome browser.

Does anyone know of a JavaScript solution that works across all broswers? We are in desperate need of being able to provide our users with a way of printing a single topic (all of the topics contents, not just what is visible on the page.)
Candee Hellberg
Sr. Communications Analyst
LexisNexis
Raleigh, North Carolina, United States
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Solution for printing an HTML5 topic from IE8?

Post by i-tietz »

candeeh wrote:We are in desperate need of being able to provide our users with a way of printing a single topic (all of the topics contents, not just what is visible on the page.)
Don't use HTML 5 output?
Inge____________________________
"I need input! - Have you got input?"
BrianBAtCeres
Propeller Head
Posts: 13
Joined: Fri Jun 12, 2015 1:57 pm
Location: Thousand Oaks, CA
Contact:

Re: Solution for printing an HTML5 topic from IE8?

Post by BrianBAtCeres »

doc_guy wrote:
candeeh wrote:Dave Lee: Your tip on adding a new toolbar button and assigning the topic.focus(); topic.print(); event worked great! Thank you so much!
Works for me in Firefox, but not in Chrome. In Chrome the button does nothing.
Still doesn't work in Chrome! :cry: (It works fine in IE and Firefox.) This is a bit of a problem since Chrome is the default browser here. Does anyone know if there's a similar solution for Chrome?

Thanks,
Brian
:flare: MadCap Flare v11, :capture: MadCap Capture v7
Post Reply