Upgrade to Pro — share decks privately, control downloads, hide ads and more …

続・パイプを通るPDF

 続・パイプを通るPDF

ワンライナーでPDFに絵を描きましょう

T. MOTOOKA

April 07, 2018
Tweet

More Decks by T. MOTOOKA

Other Decks in Programming

Transcript

  1. ୭ʁ w !U@NPUPPLB w େࡕαςϥΠτͷํ͔Βདྷ·ͨ͠ w झຯɿ47(ඳ͍ͨΓ1%'ॻ͍ͨΓ w ৬ۀ w

    1)1ॻ͍ͨΓ42-ॻ͍ͨΓ w ޿ٛͷ 1%'ॻ͍ͨΓ w )FBMUI$IFDLͷ௨Βͳ͍αʔόͷ؅ཧऀ w ݩϢʔϑΥχΞϜ૗ऀ
  2. ઢΛҾ͘ convert xc:none -page A4 pdf:-\ | gs -q -sOutputFile=-

    -sDEVICE=pdfwrite \ -c '<< /EndPage { exch pop 2 lt { newpath 200 300 moveto 10 200 rlineto closepath 0.8 0.2 0.1 setrgbcolor stroke true }{false} ifelse } bind >> setpagedevice'\ -
  3. ѹॖ͞ΕͨඳըࢦࣔΛ৳௕ convert xc:none -page A4 pdf:-\ | gs -q -sOutputFile=-

    -sDEVICE=pdfwrite \ -c '<< /EndPage { exch pop 2 lt { newpath 200 300 moveto 10 200 rlineto closepath 100 0 0 setrgbcolor stroke true }{false} ifelse } bind >> setpagedevice'\ -\ | pdftk - output - uncompress
  4. ࢀߟ̎ɿ؀ڥߏஙྫ DockerΛ࢖ͬͨྫ • docker run -it -v "$(pwd)/pdf":/pdf \
 ubuntu:16.04

    bash • exitޙͷ࠶ར༻
 docker start -ai $(docker ps -a Ͱݟ͑Δname) • apt update • apt install ghostscript imagemagick pdftk less