0

I have a webpage that contains multiple iFrames. I'm trying to get the pages to print the contents as one page but unfortunately I can't get this to print clearly. Is it possible to achieve this with some javascript or dojo if needed?

For example- this was an attempt at an answer but if you actually try using a valid src url that returns content you'll see that the contents of the page is truncated.

example here: Print preview from multiple iframes?

Note: Check out the fiddle and try substituting a local html file you have with content in it and you should see that the content is truncated and doesn't include all of it.

jimgug
  • 165
  • 3
  • 10
  • This is default behavior of iFrames. You have to give a height to each frame but you dont know how tall the contents of the iFrame might be. You might give a height too tall and have lots of white space on the bottom or too short and your cntents are truncated. Only if you know the exact height of the content of ifram (like they do in banners) then you can set it accordingly. Javascript may or may not always able to read the height of the content in iFrame. – Nawed Khan Nov 23 '18 at 21:13
  • Even if I max out the height to 100% it doesn't seem to take into account all of the content. Is there a way to say merge the content windows to one? I didn't think it would be this hard to be able to setup printing a page with only the areas needed! :/ – jimgug Nov 23 '18 at 21:52
  • 1
    it wont! because 100% of what? you are setting 100% of the parent element, be it a div, or the whole document in view.... not the 100% of the contents of the iFrame. – Nawed Khan Nov 23 '18 at 21:54
  • Is there a way to grab the html including styles from each frame I need? Then I can try to aggregate the content that way? Or say I do know the size of the content of the frame how/where can I specify it so the contents is not truncated? – jimgug Nov 23 '18 at 23:08
  • I have suggested an answer to a similar question of yours here https://stackoverflow.com/questions/53456976/print-two-contentwindows-as-one-within-an-iframe. Does that help? – customcommander Nov 24 '18 at 22:36

0 Answers0