You cannot see this page without javascript.

print script

Programing 조회 수 300 추천 수 0 2013.12.11 15:34:40
1. 프린트 할 영역의 테이블에 id 값을 준다

ex ) <table id="print_doc"> 생략... </table>

2. 프린트 할곳에 해당 스크립트 와 iframe를 하단에 삽입하며 클릭 버튼을 넣어준다.


<input type="button" value="프린트" onclick="print_();"> <!-- 버튼 넣고싶은곳에 넣는다.-->

<iframe id="hiddenFrame" name="hiddenFrame" width="0" height="0"></iframe> <!-- 팝업을 뛰우지 않기위해-->

<script language="Javascript" type="text/javascript">
<!--
function print_() {
    window.open("./print_hidden.php", "hiddenFrame");
    window.frames['hiddenFrame'].focus();
}
//-->
</script>

3. 같은 디렉토리 안에 print_hidden.php 아래 내용을 넣어서 파일을 생상한다.

<html>
<title>프린트</title>
<body leftmargin=0 topmargin=0></body>
</html>

<script language="Javascript" type="text/javascript">
<!--
function print_() {
    window.print();
}
var base = parent.location.href;
var body = parent.document.getElementById('print_doc').innerHTML;
document.body.innerHTML = "<BASE HREF='"+base+"'>" + body;
window.onload = print_;
//-->
</script>

엮인글 :
List of Articles
번호 제목 글쓴이 날짜 조회 수sort

Linux iconv 이용 문자셋 일괄 변경

  • LynX
  • 2016-07-21
  • 조회 수 330

Server tomcat error

  • LynX
  • 2014-11-11
  • 조회 수 329

Linux Fedora20 바탕화면 아이콘 설정 file

  • LynX
  • 2014-06-27
  • 조회 수 328

Xpress Engine xe 서버이전

  • LynX
  • 2014-07-10
  • 조회 수 324

Linux GLIBCXX

  • LynX
  • 2014-07-02
  • 조회 수 323

Linux MAME file

  • LynX
  • 2016-09-28
  • 조회 수 320

HardWare PacketTracer60_Build45 file

  • LynX
  • 2013-09-28
  • 조회 수 317

Linux 01 - 정규식과 표현

  • LynX
  • 2012-11-29
  • 조회 수 317

Linux PDO_MYSQL 설치 [8]

  • LynX
  • 2014-08-01
  • 조회 수 310

Linux 03 - VMware,네트워크,VMware인터넷설정,리눅스인터넷 file

  • LynX
  • 2012-11-29
  • 조회 수 305

Windows7 에서 시스템을 백업/복원하는 가장 쉬운 방법!! file

  • LynX
  • 2010-11-07
  • 조회 수 305

CentOS7 ▒ Doly의 CentOS7 강좌15 5. CentOS 기본설정 2 - 날짜 및 시간설정 file [6]

  • LynX
  • 2014-10-23
  • 조회 수 300

Programing print script

  • LynX
  • 2013-12-11
  • 조회 수 300

Linux 10 - NFS,apache file [10]

  • LynX
  • 2012-11-29
  • 조회 수 298

LinuxMint LinuxMint PHP source 설치 [1]

  • LynX
  • 2014-12-30
  • 조회 수 297

Server Windows7에 Apache 설치 file

  • LynX
  • 2013-09-05
  • 조회 수 297

Linux [Linux] 특정 계정만 su -(root)를 통한 root접근 허용

  • LynX
  • 2014-07-04
  • 조회 수 294

Programing cab파일에 인증서 포함하기

  • LynX
  • 2014-06-13
  • 조회 수 293

Linux cinnamon [10]

  • LynX
  • 2014-12-11
  • 조회 수 287

Linux Linux Apache 2.4 설치

  • LynX
  • 2014-06-27
  • 조회 수 286

XE Login