Printing a slide in Captivate 6 HTML5 output via javascript
I have been googling for the past 3 work days trying to figure this out.
I had some limited success with printing a div via javascript and pointing it at the slide div (I know it happens to be Slide16952).
Which is fine, except it doesn't keep the CSS elements of the slide which is what makes it a pretty completion certificate. Print widgets won't work because I have to publish to HTML5 and not flash (no, no choice in this). I am struggling to get any javascript working.
I have this right now which I just picked up as a generic to try and get me going
function PrintElem(elem)
{
Popup($('<div/>').append($(elem).clone()).html());
}
function Popup(data)
{
var mywindow;
mywindow = window.open('', 'mydiv','height=1280,width=720,scrollbars=no','');
mywindow.document.write('<html><head><title>my div</title>');
mywindow.document.write('<style type="text/css" media="print,screen">.hideMe{display:none;}.NoPrintClass{display:none;}</style>');
mywindow.document.write('</head><body>');
mywindow.document.write('drop down selected value in parent: '+mywindow.opener.document.getElementById('testSelect').options[mywindow.opener.document.getElementById('testSelect').selectedIndex].text+'<br/>');
mywindow.document.write('contentStarts<br/>');
mywindow.document.write(' using jquery: '+data);
mywindow.document.write(' using javascript: '+mywindow.opener.document.getElementById('mydiv').innerHTML);
mywindow.document.write('<br/>contentEnds');
mywindow.document.write('<br/>');
mywindow.document.write('</body></html>');
mywindow.document.focus();
mywindow.document.close();
mywindow.print();
return true;
}
I then point my print button at PrintElem('Slide16952') via a javascript window.
obviously I haven't written this to fit my particular project yet, but the part I am having the most issue with is trying to get the captivate CSS stuff to come through. mydiv should = Slide16952 I think. The CSS form that captivate creates has several block visible elements, but I believe the one I am trying to make sure I get is .cp-shape in CPLibrary.css, but there could be others I want too and I am not sure which.
has anyone had any luck getting a single slide printed in HTML? window.print() only gets me like 95% of the slide and a loft of white space around it.
