shell - How to print out pdf file with script generated highlighted output? -
i've been used pidcat jakewharton see log of app:
$ pidcat [org.test.myapp]
and redirect file:
$ pidcat [org.test.myapp] > ~/dev/myapp_log
the pidcat generate pretty highlighted content try keep in pdf file. i've tried:
$ cupsfilter ~/dev/myapp_log ~/dev/myapp_log.pdf
but generate plain white text pdf.
how keep beautiful highlight format in pdf file? p.s. it's long log. can't print screen..
this how original output like:
and here's partial pidcat output opened default text editor on mac:
[107m [0m process created broadcast com.nortek.app/org.videolan.vlc.phonestatereceiver [107m [0m pid: 9718 uid: 10157 gids: {50157, 3003, 1028, 1015} [101m [0m process 9718 ended [107m [0m process created activity com.nortek.app/.ui.activity.dummymainactivity [107m [0m pid: 2840 uid: 10157 gids: {50157, 3003, 1028, 1015} [31mek.app.common.apiagent[0m [30;104m d [0m @ ready send out get_all_data : http://192.168.11.59:8083/zwaveapi/data/0 [37m activitymanager[0m [30;102m [0m timeline: activity_idle id: android.os.binderproxy@4181e268 time:34298679 [32mvity.dummymainactivity[0m [30;104m d [0m @ nav item click id : 5/camera [33m volley[0m [30;101m e [0m [1] 1.onerrorresponse: error get_all_data : [30;104m d [0m [1] request.finish: 3076 ms: [ ] http://192.168.11.59:8083/zwaveapi/data/0 0x85bd6053 normal 3 [34mspannablestringbuilder[0m [30;101m e [0m span_exclusive_exclusive spans cannot have 0 length [30;101m e [0m span_exclusive_exclusive spans cannot have 0 length [35m vlc/audioservice[0m [37;100m v [0m loading position 0 in [rtsp://192.168.11.40:5454/live] [37;100m v [0m creating on-the-fly media object rtsp://192.168.11.40:5454/live [36m vlc[0m [30;104m d [0m core libvlc: no fetch required (null) (art (null)) [30;104m d [0m core demux meta: looking meta fetcher module matching "any": 0 candidates [30;104m d [0m core demux meta: no meta fetcher modules [30;104m d [0m core libvlc: searching art rtsp://192.168.11.40:5454/live [30;104m d [0m core art finder: looking art finder module matching "any": 1 candidates [30;104m d [0m core art finder: no art finder modules matched [30;104m d [0m core libvlc: art not found rtsp://192.168.11.40:5454/live [31m vlc/libvlc/media[0m [30;104m d [0m title rtsp://192.168.11.40:5454/live [30;104m d [0m artist unknown artist [30;104m d [0m genre unknown genre [30;104m d [0m album unknown album [36m vlc[0m [30;104m d [0m core input: creating input 'rtsp://192.168.11.40:5454/live'
first have convert colored shell output html pdf.
use ansi2html.sh
here
you can try smth
cat myapp_log | ansi2html.sh -p > myapp_log.html html2any myapp_log.html file.pdf
Comments
Post a Comment