"Jeff Mason" <je.mason@comcast.net> wrote in message
news:38qvk1hr6ni2r4cg96htuarf1mpka7209p@4ax.com...[color=blue]
> On Fri, 14 Oct 2005 11:44:20 -0400, "Eric Moreau"
> <eric.moreau_N_O_S_P_A_M@videotron.ca> wrote:
>[color=green]
>>To print a PDF document, you can use this code:
>>
>>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
>>System.EventArgs) Handles Button1.Click
>>Dim myProcess As Process = New Process
>>'myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
>>myProcess.StartInfo.FileName = "C:\!emoreau_misc\Doc\UG-Gestion des
>>utilisateurs.pdf"
>>myProcess.StartInfo.Verb = "Print"
>>myProcess.StartInfo.UseShellExecute = True
>>myProcess.Start()
>>myProcess.WaitForInputIdle()
>>
>>If myProcess.Responding Then
>>myProcess.CloseMainWindow()
>>Else
>>myProcess.Kill()
>>End If
>>End Sub
>>
>>You can read my article of December 2003 titled "The Process component"
>>from
>>
http://emoreau.s2i.com/.
>>
>>To select a printer, I have another article : "Setting Windows default
>>printer" (March 2005)[/color]
>
> Thanks.
>
> I am aware of the method using ShellExecute. One problem with this for me
> is that
> this presumes that some suitable renderer for the PDF file has been
> previously
> installed on the system and that an appropriate file association has been
> set up, so
> this method requires Acrobat or something like it. Another is that
> requests will
> come from users asking that a given document be printed on a printer
> specified by the
> user. This would mean that I would have to mess with setting the default
> printer,
> which is ugly at best, IMO. I've never seen a satisfactory solution to
> this issue
> either, since it requires the Windows Scripting Host. Yuck.
>
> I'm looking for a solution that doesn't involve Acrobat or the Reader, if
> possible,
> though I admit I didn't state so.
>
> The main issue with Acrobat, et al, is that the code which will be doing
> the printing
> will run on a server, and as I understand it, Adobe licenses don't allow
> Acrobat to
> be used that way.[/color]
That is my understanding too.
You need either a PDF renderer, or a translator to translate PDF to a
language supported by your printer.
I had this same issue and here's the best tool I could find: XPDF
Xpdf is an open source viewer for Portable Document Format (PDF)
files. (These are also sometimes also called 'Acrobat' files, from the name
of Adobe's PDF software.) The Xpdf project also includes a PDF text
extractor, PDF-to-PostScript converter, and various other utilities.
http://www.foolabs.com/xpdf/download.html
This included a command line tool pdftops which will transform a PDF file to
a Postscript file. The postscript file can then be copied to a postscript
printer.
David