System.Diagnostics.Process proc = new Process();
proc.StartInfo.FileName = "ACROBAT.pdf";
proc.StartInfo.WorkingDirectory = "C:\\";
proc.StartInfo.Verb = "print";
proc.Start();
I would like to use the PrintDocument and other printing object, but I
would love to see a good example of their use in the real world.
Thanks
If you want to print those types of documents, I would imagine that you
would either have to:
a) Use OLE/COM Automation to "control" Word or Acrobat Reader to open and
print the document (not sure if Acrobat Reader is an OLE Automation server,
however).
b) Build your own reader/renderer/printer for those documents, which isn't
really practical.
But there's another way, which brings up an interesting topic... DDE!
Through DDE*, you might be able to accomplish what you're looking for. I'm
not sure what commands Acrobat Reader supports, but it might be possible. I
know for sure Word supports it.
The one thing I don't know is if .NET has a library of classes/methods for
using DDE. Sounds like a good research project, however. I wouldn't be
surprised if there was support in the Framework, since the Windows File
Types dialog (and associated dialogs) allow you to set up relationships
based on DDE commands.
Hope this helps!
Evan Stone | Petaluma, CA
----------------------------------------------
C#/.NET Padawan Learner
* DDE = Dynamic Data Exchange. Sorta like a poor man's OLE, going back to
the 16-bit days. But it was actually a pretty cool way of communicating
between applications, and is still alive today.
I just found the following in the .NET help system:
> DDE Is Gone
> Dynamic Data Exchange (DDE) is no longer available
> as a technology in the .NET language. There are so
> many other methods of communicating from one
> program to another that this technology is no longer
> needed.
So, bummer. Looks like you're stuck using OLE/COM Automation, which isn't a
bad thing. You'll just have to find out 1) if Acrobat supports Automation,
and 2) what object library you have to reference. After that it should be
fairly straightforward.
In fact, looking in my reference list (on the COM tab), I see three items
that look interesting:
* Acrobat Access 2.0 Type Library
* Acrobat Control for ActiveX
* AcroIEHelper 1.0 Type Library
So it looks like Adobe was a good COM citizen and created the tools
necessary to do what you want. I'd check out the first one and see how that
goes. There's probably some information on the Adobe site about it too.
Hope this helps more than the last message!
;)
otherwise, the best you can do is hand a document to windows and hope it
can find the (installed) software that does know how to render the document
to the printer. is this what you were hoping to do?
let me know if you have more questions or if i didn't answer what you're
looking for...
jeff.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.