Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one print iframes?

I built a printable version of my data using multiple iframes to display line item details. However, if any of my iframe content is larger than a page they get cut off when printing (they display fine on the screen). All of my iframes point back to the same domain and I'm using the browser's File->Print function to do my printing. I don't think it's a browser specific bug as I get the same results in IE & FF.

What do I need to do to print an HTML document containing multiple iframes?

like image 292
William Jens Avatar asked Feb 15 '10 23:02

William Jens


2 Answers

I don't believe there's an easy way of doing this. If they're all on the same domain, why are you using IFRAMEs? Why not put the data directly in the page? If you're looking for scrolling, a div with height: ###px; overflow: auto; would allow it without having to use IFRAMEs, and a CSS print stylesheet would allow you to take the overflow/height CSS off when the user hits print.

like image 122
ceejayoz Avatar answered Oct 27 '22 18:10

ceejayoz


I found an answer here. While less than ideal, it'll allow me to print the master record first and then optionally print each line item as a seperate print job by printing each iframe individually.

like image 35
William Jens Avatar answered Oct 27 '22 17:10

William Jens