xTuple.com xTupleU Blog & News Customer Support

Print a PDF document that is Saved as a url

I want to write a script to print out a document along side work orders. this document has information for the operator that has to be on a pdf.

I cant seem to find a way to print this pdf out from the scripting environment. I would like to have it just print out when the user clicks print, but I would be okay with a solution that pulls it up an a render like the default web browser.

Caleb,

if the document exists in the file system. I use

toolbox.openUrl(filename)

It can be a pdf, word or any file type

I think that this will be my best option. thanks for the tip! I will let you know if it worked for me when I get it done

@rekosko

That doesn’t seem to do anything for me. how does that open the PDF for you? is there anything that I might need to set up

caleb
One of the issues you may have is the \ , the separator between the folder name and filename

I use

\\\\server\\folder\\filename

see if that works

Is this url on the web or a local directory? The toolbox.openUrl option works well, but it will definitely need the correct syntax. I use this all the time with web URLs. On the web it would look like this:
https://mygreatwebsite/myfolder/sample.pdf

The browser setup would determine how the pdf is handled. The setUrlHandler member function can be used for this as well, but I’m not sure that’s exposed in the scripting toolbox.

A local file might look like this: (others…please correct me if this is incorrect)
file:///C:/mygreatdesktopfolder/mysample.pdf

Note the forward slashes…which I think rekosko was alluding to.

Thanks all. It was a simple escape for my backslashes and then it worked great.