<body> 안에 아래 코드 삽입
<object id="factory" style="display:none" viewastext
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
codebase="/include/js/smsx.cab#Version=6,3,439,30"> </object>
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
codebase="/include/js/smsx.cab#Version=6,3,439,30"> </object>
오브젝트 안에 버젼정보 맞춰주고 다운받은 파일을 웹서버에 올리고 경로를 맞춰줌
<a href="#" onclick="printArea()">프린트 하기</a>
<script type="text/javascript">
function printArea() {
factory.printing.header = ""; //머릿말 설정
factory.printing.footer = ""; // 꼬릿말 설정
factory.printing.portrait = false; //false = 가로 출력 , true = 세로 출력
factory.printing.leftMargin = 0.0; // 좌측여백
factory.printing.topMargin = 0.0; // 위 여백
factory.printing.rightMargin = 0.0; // 우측여백
factory.printing.bottomMargin = 0.0; // 아래여백
factory.printing.Print(false, window);
function printArea() {
factory.printing.header = ""; //머릿말 설정
factory.printing.footer = ""; // 꼬릿말 설정
factory.printing.portrait = false; //false = 가로 출력 , true = 세로 출력
factory.printing.leftMargin = 0.0; // 좌측여백
factory.printing.topMargin = 0.0; // 위 여백
factory.printing.rightMargin = 0.0; // 우측여백
factory.printing.bottomMargin = 0.0; // 아래여백
factory.printing.Print(false, window);
// false = 프린트 대화창안열음 , true = 대화창 열음
// window = 윈도우 전체 출력 , 또는 프레임명을 넣어서 프레임을 출력한다.
}
// window = 윈도우 전체 출력 , 또는 프레임명을 넣어서 프레임을 출력한다.
}
</script>