Life IT life Current: wkhtmltopdf 를 사용해서 web page 를 PDF 로 변환하기 wkhtmltopdf 를 사용해서 web page 를 PDF 로 변환하기 개요wkhtmltopdf 와 wkhtmltoimage 는 QT Webkit 으로 작성된 오픈 소스(LGPLv3) 명령행 방식의 HTML 변환기https://wkhtmltopdf.org/downloads.html 에서 바이너리를 받아서 설치하면 됨. Windows 의 경우 MSVC 로 컴파일한 버전 권장 설치후에 쉘 초기화 파일에 다음 alias 추가 wpdf="D:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe" $* alias wpdf=wkhtmltopdf 사용설명을 보려면 -H 옵션 추가 wpdf -H 페이지를 pdf 로 저장 wpdf google.com g.pdf wpdf --viewport-size 1920x1080 --orientation Landscape google.com g.pdf 단점Webkit 을 사용했지만 브라우저에서 보는 것과 다르게 저장되는 페이지가 많이 있음. 크롬에서 보는 것과 유사한 결과물을 원할 경우 headless chrome 사용을 고려Refhttps://github.com/wkhtmltopdfhttps://pdf.iskysoft.com/create-pdf/html-to-pdf.html Please enable JavaScript to view the comments powered by Disqus. blog comments powered by Disqus ×