I am not sure if you can starting an intent with a relative file name. Better use the absolute file name and use am start to view the file:
am start -a android.intent.action.VIEW -d file:///storage/emulated/0/mypdf.pdf -t application/pdf
The link you have provided is not setting up SOCKS but a transparent proxy i.e. it takes TCP/UDP traffic and SOCKSify it before sending through shadowsocks tunnel. But you need to make your traffic SOCKS-aware before directing towards SOCKS proxy. Either configure individual apps (which have built-in support for SOCKS) or enforce proxy system-wide ...
adb push "$file" "$dest"
adb shell am start \
-a android.intent.action.ATTACH_DATA \
-c android.intent.category.DEFAULT \
-d file://"$dest" \
-t 'image/*' \
-e mimeType 'image/*'
This was the method I used, file= declares the variable for bash, use the file path of ...