프로젝트 요구로 인해 페이지에서 콘텐츠 인쇄를 선택하십시오.
DIV 레이어로 인쇄하려는 것을 선택하십시오. 예를 들어:
코드 사본은 다음과 같습니다.
<!-청원 문제의 양도 통지 시작->
<div id = "itemvrbjform"style = "font-family : 'song song', 'song style'; font-size; margin-top : 290px;"
<div>
<div style = "float : right; margin -top : -40px;"> (정보 번호 : $ {zjxfitemuser.acceptedno}) </div>
<div id = "title"style = "margin-top : 40px;"청원 문제의 양도 </span> </div>
$ {zjxfitemuser.username} : (청원 인의 이름) <br/>
<span id = "itemvrbjtime"> </span>,이 기관 (또는 단위)은 법에 따라 귀하 (또는 귀하)가 제안한 $ {zjxfitemuser.subject} 청원 문제를 수락했습니다.
청원 문제는 "편지 및 청원 규정"의 관련 조항에 따라 XXX, XXX의 XXX에 적용되었다 . <br/>
여기에 알려주세요. <br />
<div style = "margin-top : 50px; margin-right : 20px; float : right;"> (sub-sub-name} special seal 또는 공식 봉인) </div>
<div style = "margin-top : 90px; margin-right : -190px; float : right;"> <span id = "itemvrbjendtime"> </span> </div>
</div>
</div>
<!-청원 문제의 양도 통지 종료->
중간에 인쇄 할 필요가 없으며 DIV 층에도 포함되어 있습니다. CSS 스타일을 사용하십시오. 인쇄가 필요하지 않은 레이어에서 class = "noprint"를 참조하십시오.
코드 사본은 다음과 같습니다.
<스타일 유형 = "text/css"media = "print">
.noprint {가시성 : 없음;}
</스타일>
JS 코드 :
참고 : 인쇄를 선택할 때는 인쇄하기 전에 인쇄물을 추가해야합니다.
코드 사본은 다음과 같습니다.
$ (function () {
$ ( "#print"). 클릭 (function () {
var html = window.document.body.innerhtml;
Exportcss ( "itemvrbjform", html);
});
// 인쇄를 선택하려면 스타일을 가져옵니다
함수 ExportCSS (FormName, htmlinfo) {
var css = "<link href =/" " + baseurl +"/zjxf/common/css/common.css/"type =/"text/css/"rel =/"stylesheet/"/>" +
"<link href =/" " + baseurl +"/zjxf/common/css/table.css/"type =/"text/css/"rel =/"Stylesheet/"/>" +
"<link href =/" " + baseurl +"/zjxf/common/css/form.css/"type =/"text/css/"rel =/"Stylesheet/"/>" +
"<link href =/" " + baseurl +"/zjxf/common/css/tab.css/"type =/"text/css/"rel =/"Stylesheet/"/>" +
"<link href =/" " + baseurl +"/zjxf/common/css/print.css/"type =/"text/css/"rel =/"Stylesheet/"/>";
$ (css) .appendto ( "#" + formname);
window.document.body.innerhtml = $ ( "#" + formname) .html ();
Window.print ();
Window.document.body.innerhtml = htmlinfo;
}
});
이것은 부분 선택 인쇄와 부분 비 선택 인쇄를 모두 달성 할 수 있도록합니다.