Use the Microsoft Internet Transfer control.... You Pass it the URL, and tell it what you want to do with it, and it will do it. You can then save the information to a file, of the same name, or with a temporary name, and then do your printing. HOW exactly to print the PDF file from a VB App is going to be the hard part. The only method I know of, is really (Really) Tacky.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Well,
It would go a little something like this:
Dim strURL As String
Dim bData() As Byte ' Data variable
Dim intFile As Integer ' FreeFile variable
strURL = "http://yourserver.com/yourpdf.pdf"
intFile = FreeFile() ' Set intFile to an unused
' file.
' The result of the OpenURL method goes into the Byte
' array, and the Byte array is then saved to disk.
bData() = Inet1.OpenURL(strURL, icByteArray)
Open "C:\Temp\yourpdf.pdf" For Binary Access Write As #intFile
Put #intFile, , bData()
Close #intFile
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
I'm sorry,
I don't use PHP as a general rule, and therefore, I have no idea how to go about using sockets, and LWP and the like. If you needed it in perl, that would be no problem, however, There are others more proficient in PHP that can give you help.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
what does the activex control do? Are you using a control to actually LOAD the .pdf file into the VB app? What I mean is... I don't understand why you can't use the activeX control, to do whatever it does, and also use the dde printing code?
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Ok, This way isn't as elegant as I'd like for it to be, but it should work for you. Stick The following code into a module:
public sub print_pdf(xSomeFile as string)
Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe /p /h " & xSomeFile, vbHide
end sub
Keep in mind, that if adobe is a different version, or in a different path, then you will need to change the path (and possibly the .EXE name) to fit wherever you hvae installed adobe. If you are doing this for a bunch of different machines, something to consider is to search the registry for the path to the adobe exe, and use that instead of a hard coded path (which is the best way), and then call the adobe exe with the /p and /h options that way. You would use this subroutine in your code somewhere as follows:
call print_pdf "c:\mydocument.pdf"
let me know if that works for you.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
It's My Pleasure.
You are able to get the path now then?
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215