Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PDF Printing on Server

2,020 views
Skip to first unread message

Cesar K. San Jose

unread,
Dec 17, 2002, 5:00:15 PM12/17/02
to
I have an intranet app that will print PDF files to the server printer. The
print component is a DLL which calls the ShellExecute to print the files.
What I've found out is that ShellExecute doesn't work well for web-based app
becuase it opens the Adobe Reader window and prints the file. The web server
doesn't open the Adobe reader window. Do you know of a way how I can call
ShellExecute in the web server? I heard the CreateProcess is one way to use
but it's not supported in VB.Net.


Cesar


bruce barker

unread,
Dec 17, 2002, 5:55:45 PM12/17/02
to
create process will have the same limitation, as thats all ShellExecute
does. Adobe Reader is not appropriate as server pdf printer. you will need
one of the server based acrobat tools for this.

-- bruce (sqlwork.com)

"Cesar K. San Jose" <cksa...@hotmail.com> wrote in message
news:OSbzoehpCHA.2252@TK2MSFTNGP12...

Larry Hastings

unread,
Dec 18, 2002, 11:14:41 AM12/18/02
to
Try to use this one for printing PDF files http://www.cs.wisc.edu/~ghost/

--

G

"Cesar K. San Jose" <cksa...@hotmail.com> wrote in message news:OSbzoehpCHA.2252@TK2MSFTNGP12...

HPatel

unread,
Dec 19, 2002, 11:24:14 AM12/19/02
to
Refer to: Printing PDF, Word etc using StartDocPrinter OR to get a JobId
after printing doc from VB 12/17/2002 12:23PM

Refer to: StartDocPrinter, data format for PDF , word etc ?? 12/19/2002
11:?? PM ( check with the Subject its not exactly the same and i cn't see it
right now, i had just posted it)

I am also working on similar kind o project. where i am calling a DLL from
WebPage which executes ShellExecute() to print my Word , PDf or text
documents etc to Network Printer or Fax Printer. But Acrobat reader doen't
close by itself after printing, so i have do something more (Please refer to
my previous and current discussion in new group on 12/17 and 12/19) to check
for its jobid , to get it i get all before printing jobs list and after
printing job list , and compare it to get the last jobid and wait for it to
complete and then close the acrobat reader.


"Cesar K. San Jose" <cksa...@hotmail.com> wrote in message
news:OSbzoehpCHA.2252@TK2MSFTNGP12...

HPatel

unread,
Dec 19, 2002, 3:01:41 PM12/19/02
to
Private Type DOCINFO
cbSize As Long
lpszDocName As String
lpszOutput As String
lpszDatatype As String
fwType As Long
End Type

Private Declare Function StartDoc Lib "gdi32" Alias "StartDocA" (ByVal hdc
As Long, lpdi As DOCINFO) As Long
Private Declare Function StartPage Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function EndPage Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function EndDoc Lib "gdi32" (ByVal hdc As Long) As Long

Private Declare Function ShellExecute2 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 cmdPrint_Click()
Dim Pt(1 To 2) As POINTAPI
Dim bTypes(1 To 2) As Byte
Dim DI As DOCINFO
Dim lngHDC As Long

DI.cbSize = Len(DI)
DI.lpszDocName = "Visual Basic - Step by Step"
DI.lpszOutput = vbNullString
DI.lpszDatatype = vbNullString

lngHDC = Printer.hdc

Call StartDoc(lngHDC, DI)

Call StartPage(lngHDC)

If ShellExecute2(lngHDC, "PRINT", "C:\testpdf.pdf", "", "C:\", 1) <= 32
Then
MsgBox "true"
End If

Call EndPage(Printer.hdc)
Call EndDoc(Printer.hdc)
End Sub

"Cesar K. San Jose" <cksa...@hotmail.com> wrote in message
news:OSbzoehpCHA.2252@TK2MSFTNGP12...

Mark McWhirter

unread,
Mar 30, 2003, 5:01:17 PM3/30/03
to
Well, if you have got PDF's printing on your server from a web
application, then you are ahead. How did you accomplish that??

Mark McWhirter
ma...@ccwnresources.com
mangled e-mail: /cc/c/


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

0 new messages