Jump to content
Sign in to follow this  
Czar

Printing to printer on desktop/laptop - and IDE bug

Recommended Posts

Hi all,

 

I figured out that I can print using

 

asm

window.print();

end;

 

However, I actually just want to print the contents of an Iframe "W3IFrameHTMLElement1". But I have not been able to get that working. I tried a number of javascript solutions but none worked.

 

 

e.g,

 

asm

document.getElementsByName("W3IFrameHTMLElement1").print();

end;

Share this post


Link to post
Share on other sites

Excellent, I got this working

 

var printContents = W3DIVHtmlElement1.InnerHTML;

asm

var originalContents = document.body.innerHTML;

document.body.innerHTML = printContents;

 

window.print();

document.body.innerHTML = originalContents;

end;

Share this post


Link to post
Share on other sites

> Excellent, I got this working

> var originalContents = document.body.innerHTML;

> document.body.innerHTML = printContents;

> window.print();

> document.body.innerHTML = originalContents;

 

Just an idea, better approach (note that I don't know if it would work) would be to create a new window, set it's document body, print and then delete that Temp window. Thay way you do not messup with active document body.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×