Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-09-2004, 11:13 PM   PM User | #1
SlavaTT
New Coder

 
Join Date: Oct 2003
Location: Ukraine
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
SlavaTT is an unknown quantity at this point
How to print multiple html documents ?

Hi,

I have set of html documents on the server (in the DB) and I need to print them all as the one print job.
(my question is not about server side programming)
I tried to merge documents and make one page of multiple html docs and
and request them from a window to call window.print() then.
IE and NS browsers show such a 'document' but since it is a one window
background gets same for all documents.
Then I tried to put them into separate frames and iframes but all didn't work.

How to do it ?

Thanks,


Slava
SlavaTT is offline   Reply With Quote
Old 07-10-2004, 04:40 AM   PM User | #2
canadianjameson
Senior Coder

 
Join Date: Jul 2003
Location: My pimped-out igloo in Canadia
Posts: 1,966
Thanks: 36
Thanked 0 Times in 0 Posts
canadianjameson is an unknown quantity at this point
what activates the print statement? is it a link? i.e "Print XYZ"

FYI: to my knowledge you CAN do this fairly easily. it requires a javascript code (which i think i have somewhere, lemme go look)

bb
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
canadianjameson is offline   Reply With Quote
Old 07-10-2004, 04:48 AM   PM User | #3
canadianjameson
Senior Coder

 
Join Date: Jul 2003
Location: My pimped-out igloo in Canadia
Posts: 1,966
Thanks: 36
Thanked 0 Times in 0 Posts
canadianjameson is an unknown quantity at this point
okay. in all honesty my way wont work for you.

i have a link on one page that prints another URL... but for multiple documents at once you'd need a JS script... which could be handy for me as well. i hope someone gives you one.

heres what i did:
on the url "linecard.html", i have a link called

Code:
<a href="print_linecard.html" onClick="window.print();return false;"
and in the head i have

Code:
<link rel=alternate media=print href="print_linecard.html">
basically i think you'll need a javascript that will take multiple arguments at once, with an activation statement like
... printMultiple('link1.html', 'link2.html', 'link3.html', etc)
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

Last edited by canadianjameson; 07-10-2004 at 06:04 AM.. Reason: ideas
canadianjameson is offline   Reply With Quote
Old 07-10-2004, 10:09 PM   PM User | #4
SlavaTT
New Coder

 
Join Date: Oct 2003
Location: Ukraine
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
SlavaTT is an unknown quantity at this point
Post How to get correct height of the document inside of the IFRAME ?

Hi,

I decided to put each of the urls to html pages (that I need to print) to the separate IFRAMEs. So I have now complete document containing multiple pages inside, for printing.
But now I need to determine correct size of the document in each iframe to resize them (iframes) to height/width of the document.
Code:
<html>
<head>
<script language="JavaScript">
function SetFullSize()
{
 var frame1 = window.document.getElementById("frame1");
 //window.document.body.style.height = frame1.height + frame2.height;
 frame1.height = frame1.document.body.offsetHeight;
 frame1.width = frame1.document.body.offsetWidth;
}
</script>
</head>
<body onclick="SetFullSize();">
<iframe name="frame1" id="frame1" src="http://www.mail.ru" frameborder="0">
</body>
</html>
I left only one IFRAME to shorten code here.
I tested it in the IE 6.0.
When I click (to run SetFullSize) my IFRAME(s) get correct width, but height is about half less and I see vertical scroll bars on them.

How to get correct height of the document inside of the IFRAME ?

Thanks

Slava

Last edited by SlavaTT; 07-10-2004 at 10:12 PM..
SlavaTT is offline   Reply With Quote
Old 07-11-2004, 01:08 AM   PM User | #5
SlavaTT
New Coder

 
Join Date: Oct 2003
Location: Ukraine
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
SlavaTT is an unknown quantity at this point
Hi,

I've found my bug, after reading article I 'googled'.
Sorry for asking.

Slava
SlavaTT is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:21 PM.


Advertisement
Log in to turn off these ads.