> First, is there a better method of programmatically printing a .pub document
> to PDF?
Does PHP support COM? If it does, you can use Publisher (2002 or later)
as a COM server, and programmatically open the files (you can even use a
single instance if you prefer rather than opening and closing a load).
You'll probably need to reference the Microsoft Office object library
and the Microsoft Publisher object library. Then create an instance of a
Publisher object.
> Second, if not, anybody have any clues why it would hang?
No idea, sorry. I wasn't even aware of the command-line switch until you
posted!
> Third, I
> recall seeing a Publisher list of command-line switches, but I can't find
> that any more, does anyone have a link?
Nope. If you find one, can you post it here - I'll add it to my list o'
links at the website below.

Signature
Ed Bennett - MVP Microsoft Publisher
http://ed.mvps.org
Kelly M - 09 Aug 2006 17:13 GMT
I think I've found the answer, or set of answers. As I'd thought, it had to
do with permissions. Not only do all Office files need to have their
permissions set so the IUSR_<accountname> guest account for IIS can access
them, Publisher needs to have a specific "Launch Permissions" flag set. I
found the specifics in this MS KB article:
http://support.microsoft.com/kb/288366/
Also, I needed to log in as the IUSR_<accountname> account to set up a user
profile for Publisher in that account. That was also tricky, but the above
article had info on how to do that.
Once all that was done, PHP was able to successfully launch Publisher and
print a file to a PDF print driver.
- Kelly
> > First, is there a better method of programmatically printing a .pub document
> > to PDF?
>
> Does PHP support COM? If it does, you can use Publisher (2002 or later)
> as a COM server, and programmatically open the files (you can even use a
> single instance if you prefer rather than opening and closing a load).
> You'll probably need to reference the Microsoft Office object library
> and the Microsoft Publisher object library. Then create an instance of a
> Publisher object.
Yes, I've tried to instantiate a COM object through PHP, but it had the same
issue.
> > Second, if not, anybody have any clues why it would hang?
>
[quoted text clipped - 7 lines]
> Nope. If you find one, can you post it here - I'll add it to my list o'
> links at the website below.