Skip to content

Instantly share code, notes, and snippets.

@chamrc
Forked from larryxiao/* - pdf
Created October 18, 2017 08:56
Show Gist options
  • Select an option

  • Save chamrc/0966f16e2e1700b98a3973d1c84e6114 to your computer and use it in GitHub Desktop.

Select an option

Save chamrc/0966f16e2e1700b98a3973d1c84e6114 to your computer and use it in GitHub Desktop.

Revisions

  1. @larryxiao larryxiao revised this gist Jun 17, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion * - pdf
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    libreoffice --convert-to pdf *.ppt
    libreoffice --convert-to pdf *.ppt
    libreoffice --headless --convert-to pdf *.ppt
  2. @larryxiao larryxiao revised this gist Jun 7, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions readme
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    20130607

    CONVERT
    EXTRACT
    CLEANUP
  3. @larryxiao larryxiao revised this gist Jun 7, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion test
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    test
  4. @larryxiao larryxiao revised this gist Jun 7, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions test
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    test
  5. @larryxiao larryxiao created this gist Jun 7, 2013.
    1 change: 1 addition & 0 deletions * - pdf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    libreoffice --convert-to pdf *.ppt
    11 changes: 11 additions & 0 deletions clean up text
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #!/bin/bash
    for f in *.txt
    do
    echo "Processing $f file... \"$f"
    tr '\n' '||' < "$f" > "$f.temp"
    tr '\f' ' ' < "$f.temp" > "$f.out"
    mv "$f.out" ./out
    rm "$f.temp"
    # take action on each file. $f store current file name
    # cat $f
    done
    12 changes: 12 additions & 0 deletions pdf - text
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/bin/bash
    #FILES=./*.pdf
    #Processing ./20130604202323560.pdf file... "output./20130604202323560.pdf
    #for f in $FILES
    #Processing 20130604202323560.pdf file... "output20130604202323560.pdf
    for f in *.pdf
    do
    echo "Processing $f file... \"output$f.txt"
    pdf2txt -o "output$f.txt" $f
    # take action on each file. $f store current file name
    # cat $f
    done
    9 changes: 9 additions & 0 deletions readme
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    CONVERT
    EXTRACT
    CLEANUP

    libreoffice --convert-to pdf *.ppt
    pdf2txt - extracts text contents of PDF files
    pdftk
    pdftk 1.pdf 2.pdf 3.pdf cat output merged.pdf
    in alphabetical order: pdftk *.pdf cat output merged.pdf