Welcome, Guest. Please login or register.
Did you miss your activation email?
October 30, 2014, 06:11:56 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Start a .PDF from a button?
Pages: 1   Go Down
Print
Author Topic: Start a .PDF from a button?  (Read 1212 times)
0 Members and 1 Guest are viewing this topic.
aircastle
Active Member

Offline Offline

Posts: 9


View Profile
« on: February 16, 2012, 12:59:29 PM »

From a button, is there a way to open a .PDF file for a user to read? It looks like MSM is supposed to do that, but it won't work for me. Any tips would be appreciated. Thank you.
Logged
iv-cnc
Active Member

Offline Offline

Posts: 13



View Profile WWW
« Reply #1 on: February 16, 2012, 01:29:43 PM »

You can do the following (i don't know whether there is an easier way...)

create with notepad a file with extension .bat (executable with the name you want) eg. test.bat
write inside c:\test.pdf (your exact path!)

On your button write:
Shell ("c:\test.bat")


Hope it helps,
John
« Last Edit: February 16, 2012, 01:36:45 PM by iv-cnc » Logged
DaveCVI
V4 Screen Contributor

Offline Offline

Posts: 558



View Profile WWW
« Reply #2 on: February 16, 2012, 03:25:58 PM »

John,
MSM has several buttons that open PDF files in order to display various documents.
If you're an MSM user having trouble with that, please let me know and I'll assist you with the MSM aspect of the issue.

If you are looking for general info on how to do that from a mach button, there is no built in ability in the mach APIs to do that.
MSM uses a call to windows to open pdf files.

Dave
Logged

Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
iv-cnc
Active Member

Offline Offline

Posts: 13



View Profile WWW
« Reply #3 on: February 16, 2012, 03:44:59 PM »

I didn't know that!

Very nice work you have done for MSM!
Logged
aircastle
Active Member

Offline Offline

Posts: 9


View Profile
« Reply #4 on: February 16, 2012, 11:13:15 PM »

Thanks for the tips, but I can't quite get it to work. I see a DOS window flash on the screen (so fast I can't read anything), but it won't run the PDF file. I am running Windows 7.

If this were to work, it seems like video files would work, too. Great for instructional videos for users.
Logged
iv-cnc
Active Member

Offline Offline

Posts: 13



View Profile WWW
« Reply #5 on: February 17, 2012, 12:02:24 PM »

You are talking about MSM button or you used the .bat method and you see the black screen?
Logged
aircastle
Active Member

Offline Offline

Posts: 9


View Profile
« Reply #6 on: February 17, 2012, 03:56:44 PM »

I see the black DOS screen flash when using the .BAT method. Its too fast to see any possible error messages.
Logged
iv-cnc
Active Member

Offline Offline

Posts: 13



View Profile WWW
« Reply #7 on: February 17, 2012, 04:36:08 PM »

I would prefer that you will solve the problem from the MSM buttons.

Allthough, to work with the idea of a .bat file,
the black screen that disappears is the executable and its not a problem that goes away.

Check your paths! and give permitions to the bat file. (right click > properties)
Open you pdf file by making default to open with a pdf reader software.

John
Logged
DaveCVI
V4 Screen Contributor

Offline Offline

Posts: 558



View Profile WWW
« Reply #8 on: February 17, 2012, 06:20:44 PM »

Aircastle & iv-cnc,

I believe that there may be a tad of confusion here as to what is being asked about.

My understanding is that AirCastle, wants to learn how to open a PDF using a button in mach.
I'm guessing that he wants to do that as part of something he is working on.

Along the way, he appears to have noticed that our MachStdMill (MSM) product has buttons which open pdf documents.
The MSM buttons work fine and I don't think that Aircastle is saying there is a problem with MSM.
If I'm mistaken about that, and Aircastle is an MSM customer, then the thing to do is to drop into the MSM support forums and get some help (www.Calypsoventures.proboards.com)

I think the "quick blink" Aircastle describes is what he sees when using the batch file approach that iv-cnc suggested.
It's been some time since I ran a dos box batch file but that sounds like what I'd expect when shelling a batch file.
Shell opens the batch file, the batch file runs and then disappears. That happens quickly as batch files don't wait for any user input by default... so visually you see cmd DOS box flash open as a black window, the batch file executes (probably writing a few lines into the dos box that you don't get time to see) and then the cmd window closes - the visual result is quick black flash (as the cmd windows is a text window that is white text on black background).

Dave
 

« Last Edit: February 17, 2012, 06:22:17 PM by DaveCVI » Logged

Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!