Tras revisarlo quedaría así:
Código PHP:
<html>
<head>
<script>
function imprimir(soloEsto){
var contenido = document.getElementById(soloEsto).outerHTML;
ventana=window.open("about :blank","ventana","width=700,height=600,top=0,left=3000");
ventana.document.open();
ventana.document.write('<html><head><title>Imprimiendo...</title></head><body onprint="self.close()">');
ventana.document.write(contenido);
ventana.document.write('</body></html>');
ventana.document.close();
ventana.print();
ventana.focus();
ventana.close();
}
</script>
<title>Untitled</title>
</head>
<body>
<div id="pepe">Hola soy pepe.</div>
<input type=button value="EE" onclick="imprimir('pepe')">
</body>
</html>