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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...