LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to closa a pdf file

Solved!
Go to solution

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

0 Kudos
Message 1 of 7
(4,285 Views)

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.

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 2 of 7
(4,275 Views)

I am using the Simplicity PDF toolkit.

 

Then I open the pdf via the systemexec.

 

 

0 Kudos
Message 3 of 7
(4,270 Views)

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 itSmiley Happy

 

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). 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
Message 4 of 7
(4,266 Views)

I am using adobe!

 

It works fine but it close every pdf open!!!!!

 

Thanks

0 Kudos
Message 5 of 7
(4,261 Views)
Solution
Accepted by leandro31

@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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 6 of 7
(4,259 Views)

I get it working!!!

 

I open the pdf as active-x pdf vi and then I can close it by the reference!!!!

0 Kudos
Message 7 of 7
(4,231 Views)