pinaldave
asked on
printer page break and javascript iframe - help
Hello Experts,
I am trying to achive the page break for printer using one of the methods previously metnioned. in the Q
https://www.experts-exchange.com/questions/20169459/Printing-HTML-pages.html
https://www.experts-exchange.com/questions/21181900/Print-Page-Break-HTML-Page-Break.html
But when I print the javascript it does not insert the page break please guide me.
<style>
.breakhere {page-break-after:always}
</style>
<iframe name="backFrame" id="backFrame" height="0" width="0"></iframe>
<input type=button value="Print" onClick="printMe(myGenerat edHTML)">
<script>
myGeneratedHTML='something <span class="breakhere"> </span>somethingagai n'
function printMe(myGeneratedHTML) {
window.frames["backFrame"] .document. write(myGe neratedHTM L)
window.frames["backFrame"] .document. close()
setTimeout('window.frames[ "backFrame "].focus() ;window.fr ames["back Frame"].pr int();',10 0)
}
</script>
Regards,
---Pinal
I am trying to achive the page break for printer using one of the methods previously metnioned. in the Q
https://www.experts-exchange.com/questions/20169459/Printing-HTML-pages.html
https://www.experts-exchange.com/questions/21181900/Print-Page-Break-HTML-Page-Break.html
But when I print the javascript it does not insert the page break please guide me.
<style>
.breakhere {page-break-after:always}
</style>
<iframe name="backFrame" id="backFrame" height="0" width="0"></iframe>
<input type=button value="Print" onClick="printMe(myGenerat
<script>
myGeneratedHTML='something
function printMe(myGeneratedHTML) {
window.frames["backFrame"]
window.frames["backFrame"]
setTimeout('window.frames[
}
</script>
Regards,
---Pinal
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you very much mplungjan...
That worked like magic.
:)
---Pinal
That worked like magic.
:)
---Pinal
your style should be
page-break-before:always;
use div as opposed to span.
div is a block element, and page-break-before apply to block element, however I'm not sure span will work with it!