Golfreeze.packetlove.com: Life style of Golfreeze Canon400D Family kammtan.com Jazz Freebsd Unix Linux System Admin guitar Music

All about unix linux freebsd and FAQ for Packetlove.com Web hosting , Mail hosting , VoIP + IP PBX server => all application on unix knowledges by golfreeze => Topic started by: golfreeze on มิถุนายน 18, 2018, 07:24:34 PM

Title: htmltopdf wikitopdf
Post by: golfreeze on มิถุนายน 18, 2018, 07:24:34 PM
วันนี้มีโจทย์คือ แปลง wiki ที่อยู่ใน github เป็นไฟล์ pdf ครับ
หลังจากลองหาข้อมูลดู ก็มี tool ให้ใช้อยู่ เช่นตัว gwtc , wkhtmltopdf ครับ สามารถติดตั้งใน ubuntu,centos ได้

https://wkhtmltopdf.org/downloads.html
แต่ต้องทำการลง node.js ให้เรียบร้อยก่อน และ

##install nodejs
apt install npm
npm install -g github-wikito-converter

##Clone your Wiki.
git clone https://github.com/yakivmospan/github-wikito-converter.wiki.git

##And finally convert it.
gwtc ./github-wikito-converter.wiki
wkhtmltopdf https://github.com/Security-Onion-Solutions/security-onion.wiki.git so.pdf

##headless fixed bug then use xvfb instead on ubuntu and debian box.
apt install xvfb
xvfb-run -- /usr/bin/wkhtmltopdf --lowquality documentation.html documentation.pdf