Print a PDF transparently

Roger Upole rupole at hotmail.com
Tue Feb 21 00:27:15 EST 2006


This seems to work ok with acrobat 7  (don't know if it will work
with earlier versions).  The only thing I had to tweak was
acrobat's security setting for allowing print via script operations.
I didn't try to figure out how to wait until the print was finished.

      hth
            Roger


import win32com.client, time
ie = win32com.client.Dispatch('InternetExplorer.Application')
## ie.Visible=1
ie.Navigate('somedocument.pdf')
while ie.Busy:
    time.sleep(1)
ie.Document.printPages(1,3)

"Daniel Crespo" <dcrespo at gmail.com> wrote in message news:1140441655.077989.221240 at f14g2000cwb.googlegroups.com...
>> Have you seen this?
>>     http://tgolden.sc.sabren.com/python/win32_how_do_i/print.html
>> In particular, the section on using win32print directly.
>
> Yes, I have. The problems is that an external program is launched for
> handling the file and print it. In the case of PDF, acrobat is
> launched. In the case of PS, Ghostview is launched. When printing a
> PDF, acrobat keeps alive, so the user has to close it manually. On the
> other hand, Ghostview is opened, prints the file and closes
> automatically. The last one is which I find the best for me, until now,
> (because the Ghostview closes automatically). If I decide to go this
> way, my problem then is to transform a pdf to ps, or generate a ps
> directly.
>
> For further information on what I want, please, refer to my first two
> posts in this topic.
>
> Any other help?
>
> Thank you very much
> 



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----



More information about the Python-list mailing list