Hi so i have a code where it supposed to print out hardcopy of a pdf documents. Issue is i got said error when trying to print it when i set the path using ip/url.
def printInvoice(inv_id):
_filepath = "http://192.168.0.72:8000/AR/invoice/"+inv_id+".pdf"
print(_filepath)
printTheFile(_filepath)
def printTheFile(_file):
currentprinter = win32print.GetDefaultPrinter()
win32api.ShellExecute(0, 'print', _file, None, ".", 0)
time.sleep(1)
os.system("TASKKILL /F /IM Acrobat.exe")
inv_id = "INV2204-001"
printInvoice(inv_id)
If i set the path to just print it out directly from the script folder like "AR\\invoice"
it works fine
Anyway, i make the folder available by using python -m http.server
which makes it also available to be access on browser.
The goal is to make it able to work on multiple devices and print the pdf over the internet from one device that stores the docs.