Using VB Code - Silent download pdf from server and print to local printer

Thread Solved

Join Date: Jan 2005
Posts: 5
Reputation: pepsoft239 is an unknown quantity at this point 
Solved Threads: 0
pepsoft239 pepsoft239 is offline Offline
Newbie Poster

Using VB Code - Silent download pdf from server and print to local printer

 
0
  #1
Jan 18th, 2005
Hi All

I have a requirement to develop a VB application to download a pdf file from a server using an example URL
http://xxxxxxxxxxxxx/pdffiles/yyyyy.pdf.

I need to perform a silent download and print the same to the local printer. As this is going to be a scheduled task, I need to perform a silent download and print.

Please help me if any pointers to the above.

Thanks in advance
Praveen
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Using VB Code - Silent download pdf from server and print to local printer

 
0
  #2
Jan 18th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 5
Reputation: pepsoft239 is an unknown quantity at this point 
Solved Threads: 0
pepsoft239 pepsoft239 is offline Offline
Newbie Poster

Re: Using VB Code - Silent download pdf from server and print to local printer

 
0
  #3
Jan 19th, 2005
Hi Comatose

Thanks for the reply.

I was able to obtain some VB code for printing a PDF file to default printer using a local VB application.

My hard part is for downloading the PDF file from Server. If you can give me more details on getting this done with Internet Transfer Protocol, it would be really great.

Can you give me some pointers on how to do the same? If possible, some hyperlinks etc?

Thanks a lot for the response.
Praveen
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Using VB Code - Silent download pdf from server and print to local printer

 
0
  #4
Jan 19th, 2005
Well,

It would go a little something like this:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim strURL As String
  2. Dim bData() As Byte ' Data variable
  3.  
  4. Dim intFile As Integer ' FreeFile variable
  5. strURL = "http://yourserver.com/yourpdf.pdf"
  6.  
  7. intFile = FreeFile() ' Set intFile to an unused
  8. ' file.
  9. ' The result of the OpenURL method goes into the Byte
  10. ' array, and the Byte array is then saved to disk.
  11.  
  12. bData() = Inet1.OpenURL(strURL, icByteArray)
  13.  
  14. Open "C:\Temp\yourpdf.pdf" For Binary Access Write As #intFile
  15. Put #intFile, , bData()
  16. Close #intFile
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 5
Reputation: pepsoft239 is an unknown quantity at this point 
Solved Threads: 0
pepsoft239 pepsoft239 is offline Offline
Newbie Poster

Re: Using VB Code - Silent download pdf from server and print to local printer

 
0
  #5
Jan 20th, 2005
Hi Comatose

I really appreciate all your help.

I was able to tweak around with your code and got the code working. I am now able to download a PDF silently using VB Code.

Thanks once again
Praveen
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Using VB Code - Silent download pdf from server and print to local printer

 
0
  #6
Jan 20th, 2005
The Pleasure is Mine.
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 5
Reputation: pepsoft239 is an unknown quantity at this point 
Solved Threads: 0
pepsoft239 pepsoft239 is offline Offline
Newbie Poster

Re: Using VB Code - Silent download pdf from server and print to local printer

 
0
  #7
Jan 21st, 2005
Hi Comatose

I have raised one more thread on PHP. Can you please let me know if you have any idea on the same too?

Thanks
Praveen
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Using VB Code - Silent download pdf from server and print to local printer

 
0
  #8
Jan 21st, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 2
Reputation: alexjp is an unknown quantity at this point 
Solved Threads: 1
alexjp alexjp is offline Offline
Newbie Poster

Re: Using VB Code - Silent download pdf from server and print to local printer

 
0
  #9
Feb 7th, 2005
Hi,

Does anybody know how to automate printing of PDF files using VB or C++. I have to print 100 pdf files at a time and trying to find someting like .Print to do it.

Thank you in advance.

Alex
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Using VB Code - Silent download pdf from server and print to local printer

 
0
  #10
Feb 7th, 2005
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC