05-31-2011 06:02 PM
Hello everybody!
I know that open a pdf file in labview was more then discussed in here. However I couldn't find anything about closing a pdf file.
Here is the deal!
I am generating a pdf report after I finish my test, then i save and open this pdf report. If for some reason the user retest the same SN while the last report is still open my report crashes because it is still open.
I would be happy if only I could detect that pdf report is open and then display a message saying to close the file, but the ideal is to close the file before crash.
Any idea>>>
Leandro
Solved! Go to Solution.
06-01-2011 12:33 AM
Hi,
I hope that may be you are using PDF toolkit to generate the PDF report. In the Store PDF VI there is one option Close document, makeit true it will help you to close the PDF file.
06-01-2011 12:50 AM
I am using the Simplicity PDF toolkit.
Then I open the pdf via the systemexec.
06-01-2011 01:02 AM
What program do you use to open the pdf? Acrobat Reader? If so, you can kill the acrobat reader process. It's not a good way to do it, but it is one way to do it![]()
On my computer Acrobat Reader is listed as AcroRd32.exe. Tho kill it, I can send the command "taskkill /F /IM acrord32.exe" without the qoutations to the systemexec Vi.
A better way could be to get the task list by sending the command "tasklist" to systemexec Vi. Then search for "acro" and then get the full name. Incase the name could have a different ending (i.e 64 instead of 32).
06-01-2011 01:49 AM
I am using adobe!
It works fine but it close every pdf open!!!!!
Thanks
06-01-2011 01:52 AM
@leandro31 wrote:
I am using the Simplicity PDF toolkit.
Then I open the pdf via the systemexec.
I'd recommend Open a ActiveX object to Acrobat Reader and it should be easy to control the load and close of the document. (Dont forget to close the object)
/Y
06-02-2011 12:42 AM
I get it working!!!
I open the pdf as active-x pdf vi and then I can close it by the reference!!!!