iframe printing

  • JiRaffe
  • Newbie
  • Newbie
  • User avatar
  • Posts: 13
  • Loc: Liverpool

Post 3+ Months Ago

i have a page which has a scrolling iframe as part of it. i need to figure out a way that people can print the page including the entire content of th iframe. i thought one way of doing it may be to alter the size of the iFrame when the user clicked print. i know you can use external css stylesheets to implement when printing but you can't control an iframe using that can you?

any suggestions would be much appreciated
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Printing and scrolling frames generally don't mix. This is one of the reasons so many are against them. Is it possible you could create a page that generates a "Print View" of the content, displaying it how you'd like on a single regular HTML page, then have the user print that?
  • JiRaffe
  • Newbie
  • Newbie
  • User avatar
  • Posts: 13
  • Loc: Liverpool

Post 3+ Months Ago

yeah thats a possibility but i was hoping to avoid using a "printer-friendly" button as not all users think to click them.

i've tried putting the iFrame inside a Div. The Div is set at 250px height and the iFrame at 100% height. Using css i had it working so that when the user clicked print the Div resized to 600px and the iFrame stretched accordingly.

unfortunately, i've found that printers don't like this system if the iframe exceeds the height of the piece of paper. rather than go onto a second page, it just prints 1 page.

i'm thinking there may be a solution using Javascript but i'll post the question in the coding section instead

cheers for the advice
  • conorific
  • Proficient
  • Proficient
  • User avatar
  • Posts: 350
  • Loc: NY

Post 3+ Months Ago

I wouldn't use iframes. Try plain divs instead, they scroll too.
  • conorific
  • Proficient
  • Proficient
  • User avatar
  • Posts: 350
  • Loc: NY

Post 3+ Months Ago

I wouldn't use iframes. Try plain divs instead, they scroll too. Also, I think you're right about the JavaScript thing, there may also be a way in CSS, if js doesn't work.
  • JiRaffe
  • Newbie
  • Newbie
  • User avatar
  • Posts: 13
  • Loc: Liverpool

Post 3+ Months Ago

i would've preferred to use a scrolling div but i needed to use anchor points within the scrolling section. couldn't get them to work in any Mac browser and IE Mac and Opera totally screwed up the Div whilst trying to do it
  • conorific
  • Proficient
  • Proficient
  • User avatar
  • Posts: 350
  • Loc: NY

Post 3+ Months Ago

:? That's really weird. Can you be more specific as to how they're messed up? Or would you rather not go down this path at all?

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 45 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.