online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
Look in the other 2 files.
#!/bin/bash input () { usrPDF=$1 dest=$2 if [ ! -f $usrPDF ]; then echo "No such PDF was found, try again." exit else echo "$usrPDF selected!" fi if [ -d "${dest}" ]; then echo "${dest} Already exists (possible from a other run with this script) - Please enter a another directory path." exit else mkdir -p "${dest}" fi } generatePageHTML() { local title=$1 local text=$2 local images=$3 local destination=$4 imageHTML="" for image in $images; do imageHTML="$imageHTML <img src=\"$(basename $image)\"/>" done cat <<HTML > "$destination.html" <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>$title</title> <style> img { border: 1px solid black; } </style> </head> <body> <pre> $text </pre> $imageHTML </body> </html> HTML } extractImages() { pdfimages "$usrPDF" -f "$1" -l "$1" "$dest/page$1/img" for p in $dest/page$1/*ppm; do pnmscale -width=600 $p | ppmtojpeg -greyscale > ${p%.*}.jpg; done rm $dest/page$1/*.ppm } exportPage() { pc=$(pdfinfo $usrPDF | grep -o 'Pages[^,]\+' | grep -o '[^:[:space:]]\+$') for ((currentPage=1;currentPage<=$pc; currentPage++)); do mkdir "$dest/page$currentPage"; extractImages "$currentPage" pageText=$(pdftotext "$usrPDF" -f "$currentPage" -l "$currentPage" -nopgbrk -) generatePageHTML "$usrPDF - Page $currentPage" "$pageText" "$dest/page$currentPage/img*" "$dest/page$currentPage/page$currentPage" done } input "$1" "$2" echo "Working..." exportPage "$1" echo "Conversion done!"
input () { usrPDF=$1 port="${2:-8000}" if [ -f $usrPDF ]; then ./pdftosite.sh "$usrPDF" ".pdfserve/site" echo "$usrPDF selected!" else echo "No such PDF was found, try again." fi if [[ $port -lt 1024 || $port -gt 65535 ]]; then echo "Port is out of range, try again." exit 1 else bash -c "cd .pdfserve/site;python3 -u -m http.server $port 2> ../log.txt" fi } if [ ! -d .pdfserve ]; then mkdir -p .pdfserve; # if .pdfserve already exists, remove any old subfolders from pdftosite.sh elif [ -d .pdfserve/*/ ] then echo "Contains old files, removing.." rm -r .pdfserve/*/ fi input "$1" "$2"

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue