Try it with this command: xdg-open "/System/Library/Image Capture/Devices/VirtualScanner.app/Contents/Resources/simpledoc.pdf"
Achieves the same result as the 'original code', but eliminates the need for the 'file_path' variable. Make sure you installed 'xdg-utils'.