웹에서 프린터 출력시 상단하단 없이 출력하기 정보
웹에서 프린터 출력시 상단하단 없이 출력하기
첨부파일
본문
문서에서 출력하는 방식으로 출력합니다.
좀 오래된 것 같은데 필요한 부분이 많이 있을것 같네요..
출력할 페이지에 아래의 코드를 삽입한다.
<!-- MeadCo ScriptX -->
<object id=factory style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="(자기경로)/smsx.cab#Version=7.4.0.8 "></object>
// 스크립트에 아래코드 추가
function printPage(){
factory.printing.header = "가로 페이지 인쇄"; //머릿말 설정
factory.printing.footer = ""; //꼬릿말 설정
factory.printing.portrait = false; //출력방향 설정: true-세로, false-가로
factory.printing.leftMargin = 1.0; //왼쪽 여백 설정
factory.printing.topMargin = 1.0; //위쪽 여백 설정
factory.printing.rightMargin = 1.0; //오른쪽 여백 설정
factory.printing.bottomMargin = 1.0; //아래쪽 여백 설정
// factory.printing.printBackground = true; //배경이미지 출력 설정:라이센스 필요
factory.printing.Print(false); //출력하기
}
// 인쇄버튼에서 해당 함수 실행
$( "#print" ).click(function(){
if( navigator.userAgent.indexOf("MSIE") > 0 ){
printPage();
} else if( navigator.userAgent.indexOf("Chrome") > 0){
window.print();
}
});
라이센스관련
http://scriptx.meadroid.com/license-pricing/free-deployment.aspx
Free Printing
A basic subset of ScriptX client-side printing functionality -- header & footer settings, printed orientation, coarse control of margins and a browser window/frame printing command -- is available at no charge, and is freely distributable.
ScriptX 클라이언트 측 인쇄 기능(헤더 및 바닥글 설정, 인쇄 방향, 여백의 거친 제어 및 브라우저 창/프레임 인쇄 명령)의 기본 하위 집합은 무료로 제공되며 무료로 배포됩니다.
배경이미지 크기 760 x 1102
<html> <style> <table style="width:690px;"> <script language=javascript> |
참고로 배경 이미지가 출력이 안될 경우
배경색 및 이미지 인쇄 앞에 체크가 안되어 있을때 안나옵니다.
8