• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Printing Button on WebHelp Skin

Guest
Dec 12, 2006 Dec 12, 2006

Copy link to clipboard

Copied

Hi,

I am generating webhelp.

I was able to follow the instructions and create a custom button on the WebHelp Skin and to print the topic which is open. When I try to print it prints a page with the Toolbar of the skin but no contents..

Code used

if (top.frames[1].frames[1].frames[1] != null)
{
top.frames[1].frames[1].frames[1].focus(); window.print();
}
else
{
top.frames[1].frames[1].focus(); window.print();
}

Please help

Views

2.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Jan 11, 2007 Jan 11, 2007
kewel -

It seems that IE tabs don't affect the frame references.

The script you were using instructed the browser to, if the toolbar frame exists, print it; otherwise, print the contents frame. Well, you always have the toolbar frame if you see the print button, so it makes no sense.

All you really need is the second print statement in your Inline Javascript:

function PrintIt()
{
top.frames[1].frames[1].focus(); window.print();
}

...and be sure to add PrintIt() to your onclick event.

Votes

Translate

Translate
LEGEND ,
Dec 12, 2006 Dec 12, 2006

Copy link to clipboard

Copied

Hi Kewal

Where did you get your script? Your description seems to imply that you are simply printing the frame the button is in. Also, what browser and version?

Cheers... Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 12, 2006 Dec 12, 2006

Copy link to clipboard

Copied

Hi Rick,

To be honest I dont remeber it where I got the script but until i recall it was from one of the forums which directed me to Peter's or one the great authors like you
:)


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 12, 2006 Dec 12, 2006

Copy link to clipboard

Copied

Hi again

Have you tried the script in my Skinny on Skins file?

javascript:parent.frames[1].bsscright.focus();window.print();

Maybe that will help? Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 12, 2006 Dec 12, 2006

Copy link to clipboard

Copied

Hi Rick,

hmmm..this didnt work..
I replaced my code with code above code..

:|

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 12, 2006 Dec 12, 2006

Copy link to clipboard

Copied

And forgot..
using IE 7.0.5450.4

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 12, 2006 Dec 12, 2006

Copy link to clipboard

Copied

Hmmm, could be that IE7 is the culprit here. Have you tried this using an earlier version of IE?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 12, 2006 Dec 12, 2006

Copy link to clipboard

Copied

Not yet will do it soon..

But even if it works in <IE7 is not good, as my help can be used by any version of IE's or other browsers.

Is there another way to slove this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 12, 2006 Dec 12, 2006

Copy link to clipboard

Copied

Hi again

If my hunch is correct and it is an IE 7 specific issue, I'm guessing the scripts will need revising.

Cheers... Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 13, 2006 Dec 13, 2006

Copy link to clipboard

Copied

hmmm...

well some more troubleshooting...

Using the code I was able to print the default page that opens up, i.e. Home page. But when I open any other page it will just print the toolbar..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 13, 2006 Dec 13, 2006

Copy link to clipboard

Copied

ahh..got it..the problem was with IE7 tab function..

using any of the below script would only print the frame..the script does not work for tabbed windows..

javascript:parent.frames[1].bsscright.focus();window.print();

OR

if (top.frames[1].frames[1].frames[1] != null)
{
top.frames[1].frames[1].frames[1].focus(); window.print();
}
else
{
top.frames[1].frames[1].focus(); window.print();
}

So yes Rick, the script needs some revision..

Any help on that?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 14, 2006 Dec 14, 2006

Copy link to clipboard

Copied

hmm..still not able to figure this out..
any help?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 20, 2006 Dec 20, 2006

Copy link to clipboard

Copied

here's the script i use. I just added it to the template used on each page (in the footer).

I can't remember where i found it (either Rick or Peter's site).




<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var message = "Print This Page";

function printpage() {
window.print();
}

document.write("<form><input type=button "
+"value=\""+message+"\" onClick=\"printpage()\"></form>");

//-->

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 21, 2006 Dec 21, 2006

Copy link to clipboard

Copied

Hi Brj311,

Thx for the script, I agree it will work.
But this is not something that I can use in the webhelp skin custom button.

Not sure if javascript has got some tag known as "tab.print" as window.print in IE7 should not work due to the tab feature..

Not sure if am right or not..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 26, 2006 Dec 26, 2006

Copy link to clipboard

Copied

Kewel -

Paste this script into your target page; it will outline what frames/tabs are involved. You can build your print() based on the structure it displays, but you will need to accomodate both versions of IE, so be sure to include a test in your print function to determine which frames exist (similar to your IF statement in your first post).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 22, 2007 Jan 22, 2007

Copy link to clipboard

Copied

Hi All,

Thx for your help Roger, this is now working all fine.
The problem was with my IE not sure why or how!!
I tested it on developers computer IE and it worked just fine.

Guess I should have done this ages back, sorry my bad!

Thx heaps to Roger and others

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 22, 2007 Jan 22, 2007

Copy link to clipboard

Copied

LATEST
Hi All,

Thx for your help Roger, this is now working all fine.
The problem was with my IE not sure why or how!!
I tested it on developers computer IE and it worked just fine.

Guess I should have done this ages back, sorry my bad!

Thx heaps to Roger and others

This question was answered by Roger N, on Monday, January 22, 2007 12:59 PM

Answer
kewel -

It seems that IE tabs don't affect the frame references.

The script you were using instructed the browser to, if the toolbar frame exists, print it; otherwise, print the contents frame. Well, you always have the toolbar frame if you see the print button, so it makes no sense.

All you really need is the second print statement in your Inline Javascript:

function PrintIt()
{
top.frames[1].frames[1].focus(); window.print();
}

...and be sure to add PrintIt() to your onclick event.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 26, 2006 Dec 26, 2006

Copy link to clipboard

Copied

Hi Roger,

Thx for the script, much appreciate.

I did the below:
1. I used the script in the template that my topics are using, so I pasted the script in my template. For the print button I used both scripts from Rick and the script I had - None of this worked, no print command would execute.

2. So I used your script in one topic only, what I noticed in my output for that topic it displayed the below, the print button on the screen worked but it prints only toolbar like before.
file:///C:/abcd%20and%20abcd/abcd/Desktop/Output/New%20Folder%20(2)/NewProject.htm
contains:
The frame named , frames[0] (Title: "WebHelp Navigation Toolbar", file:///C:/abcd%20and%20abcd/abcd/Desktop/Output/New%20 2)/whskin_tbars.htm)
The frame named , frames[1] (Title: "", file:///C:/abcd%20and%20abcd/abcd/Desktop/Output/New%20%20(2)/whskin_frmset01.htm), which contains
The frame named , frames[0] (Title: "", file:///C:/abcd%20and%20abcd/abcd/Desktop/Output/New%20%20(2)/whskin_frmset010.htm), which contains
The frame named , frames[0] (Title: "WebHelp Navigation Mini-bar", file:///C:/abcd%20and%20abcd/abcd/Desktop/Output/New%20%20(2)/whskin_mbars.htm)
The frame named , frames[1] (Title: "Navigation Pane", file:///C:/abcd%20and%20abcd/abcd/Desktop/Output/New%20%20(2)/whskin_pdhtml.htm), which contains
The frame named , frames[0] (Title: "Table of contents", file:///C:/abcd%20and%20abcd/abcd/Desktop/Output/New%20%20(2)/whtdhtml.htm)
The frame named bsscright, frames[1] (Title: "advance search", file:///C:/abcd%20and%20abcd/abcd/Desktop/Output/New%20%20(2)/advance_search.htm)

I guess am doing something wrong, not sure what. Doing some more thinking and troubleshooting lets see what happens.

Thx again

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 27, 2006 Dec 27, 2006

Copy link to clipboard

Copied

Kewel -

That script shouldn't really be in your template, as it doesn't help to print anything, it just reflects the hierarchy of frames in the current topic. You would use the information it provides to create your path in your print statement. Delete it from the page once you have figured it out.

I'll give it a look when I access a project later today.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 03, 2007 Jan 03, 2007

Copy link to clipboard

Copied

Hi Roger ,

I have removed the script from the template, but am wondering if am suppose to use this script on my target page?do you mean all topics of the help?this would be lots of copy/pasting I dont mind but would be lot of work if any changes to the script is required at a later stage..may be in a later version of RH..or something like that..

hmm..testing the script in a demo project's topics..

thx

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 04, 2007 Jan 04, 2007

Copy link to clipboard

Copied

Kewel -

The script is just an investigative tool. Use it to determine exactly what your path is to that bsscright frame. Once you post it into a topic, you can read the name(s) of the frames in your project, and create the appropriate path for the print() command. You will want to remove the script entirely once you have figured out what the frame hierarch is. something like "frame[0].frame[0].bsscright.focus(); print(); or something like that....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 11, 2007 Jan 11, 2007

Copy link to clipboard

Copied

kewel -

It seems that IE tabs don't affect the frame references.

The script you were using instructed the browser to, if the toolbar frame exists, print it; otherwise, print the contents frame. Well, you always have the toolbar frame if you see the print button, so it makes no sense.

All you really need is the second print statement in your Inline Javascript:

function PrintIt()
{
top.frames[1].frames[1].focus(); window.print();
}

...and be sure to add PrintIt() to your onclick event.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 16, 2007 Jan 16, 2007

Copy link to clipboard

Copied

I have a similar problem... I'm trying to add (mouse over) alt text to a custom print button in the nav bar of a skin (for 508 compliance). The code I used is:

onclick: PrintTopic()

and the inline javascript is

function PrintTopic()
{
parent.frames[1].frames[1].focus();
parent.frames[1].frames[1].print();
}

Maybe this code will work for you. But what do I do about the alt text?
I am not a developer, but I think I need to add an OnLoad action. Can you help me? Thanks!
Product version: x5
OS: Windows XP Pro
Browser: Microsoft IE 6.0.29

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 17, 2007 Jan 17, 2007

Copy link to clipboard

Copied

One of the developers where I work gave me this script, which displays alt text for custom buttons:

In the onload use this

createAlt();

and in the inline javascript try this

function createAlt()
{
imgObj=document.getElementById('btncustom13639');
imgObj.innerHTML="<img src=\"bt_print_up.gif\" alt=\"Print\" border=\"0\">";
}
You may have to change the ID for btncustom.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 16, 2007 Jan 16, 2007

Copy link to clipboard

Copied

quote:

Originally posted by: Roger N
kewel -

It seems that IE tabs don't affect the frame references.

The script you were using instructed the browser to, if the toolbar frame exists, print it; otherwise, print the contents frame. Well, you always have the toolbar frame if you see the print button, so it makes no sense.

All you really need is the second print statement in your Inline Javascript:

function PrintIt()
{
top.frames[1].frames[1].focus(); window.print();
}

...and be sure to add PrintIt() to your onclick event.




hmm..well i tired this script but still the same problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp