웹에서 인쇄하는 데 도움이 되는 작은 자바 스크립트 라이브러리입니다.
https://github.com/crabbly/print.js
Print.js는 주로 인터페이스를 벗어나지 않고 임베드를 사용하지 않고 앱 내에서 PDF 파일을 직접 인쇄 할 수 있도록 작성되었습니다. 사용자가 PDF 파일을 열거 나 다운로드 할 필요가 없고 대신 인쇄 만하면 되는 고유 한 상황의 경우.
<button type="button" onclick="printJS('docs/printjs.pdf')">
Print PDF
</button>
<button type="button" onclick="printJS({
printable: someJSONdata,
type: 'json',
properties: ['name', 'email', 'phone'],
header: '<h3 class="custom-h3">My custom header</h3>',
style: '.custom-h3 { color: red; }'
})">
Print header raw html
</button>
printJS({
printable: ['images/print-01-highres.jpg', 'images/print-02-highres.jpg', 'images/print-03-highres.jpg'],
type: 'image',
header: 'Multiple Images',
imageStyle: 'width:50%;margin-bottom:20px;'
})
<button type="button" onclick="printJS({ printable: 'printJS-form', type: 'html', header: 'PrintJS - Form Element Selection' })">
Print Form with Header
</button>
등록된 댓글이 없습니다.