댓글 검색 목록

[javascript] 웹 인쇄를 위한 참 좋은 라이브러리

페이지 정보

작성자 운영자 작성일 20-09-05 17:07 조회 704 댓글 0

웹에서 인쇄하는 데 도움이 되는 작은 자바 스크립트 라이브러리입니다.


https://printjs.crabbly.com/

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>


댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.