|
-
Jun 12th, 2006, 06:29 AM
#1
Thread Starter
Hyperactive Member
print .pdfs programmatically
Just started a new porject that will involve automating the print of .pdf files
I've just tried using this:
NET USE LPT3: "\\box\printername"
TYPE "\\T095118.pdf" > LPT3:
NET USE LPT3: /DELETE
to print and it comes out with loads of gobbledgook.
How can you (in vb or vb.net) do this? i've done a bit of googling and there seems to be a lot of components out there that cost loads of money. are there any free/open source ones?
Any help or pointers ill be much appreciated.
-
Jun 12th, 2006, 06:31 AM
#2
Re: print .pdfs programmatically
goto www.neevia.com they have a good collection of pdf conversion tools and also sample codes in all major languages
-
Jun 12th, 2006, 06:32 AM
#3
Re: print .pdfs programmatically
Try something like this
VB Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Dim PrintIt As Long
PrintIt = ShellExecute(Me.hwnd, "PRINT", "C:\My Documents\TimeSheet.pdf", "", "", -1)
End Sub
-
Jun 12th, 2006, 06:32 AM
#4
Re: print .pdfs programmatically
-
Jun 12th, 2006, 08:48 AM
#5
Thread Starter
Hyperactive Member
Re: print .pdfs programmatically
Thanks a lot for the replies.
Hack, how would i go about rewriting your approach for vb.net?
also should it work if i want to print multiple pdf's as i tried adding a second shellexecute line in and it only printed the first doc.
-
Jun 12th, 2006, 08:52 AM
#6
Re: print .pdfs programmatically
 Originally Posted by sagey
Hack, how would i go about rewriting your approach for vb.net?
Don't know
 Originally Posted by sagey
also should it work if i want to print multiple pdf's as i tried adding a second shellexecute line in and it only printed the first doc.
Load all the file names into something like a listbox, and just loop through feeding the listbox entires to the ShellExecute API.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|