Sign in to follow this  
Followers 0
water

Automate printing of PDF files

4 posts in this topic

Hi AutoIt-Gurus,

I would like to automate the printing of PDF files using Adobe Acrobat Reader 8.1. For each file I would like to set the printer, orientation ...

I tried

ControlCommand($In & ".PDF - Adobe Reader","",1136,"SelectString",$Printer)
to select a printer from the combobox but it doesn't work.

I've read the Note in the AutoIt Help:

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

but AutoIt Info Window tells me that it's a ComboBox.

Can it be done using ControlCOmmands or could someone suggest anotehr approach?

Thanks in advance


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites



Hi AutoIt-Gurus,

I would like to automate the printing of PDF files using Adobe Acrobat Reader 8.1. For each file I would like to set the printer, orientation ...

I tried

ControlCommand($In & ".PDF - Adobe Reader","",1136,"SelectString",$Printer)
to select a printer from the combobox but it doesn't work.

I've read the Note in the AutoIt Help:

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

but AutoIt Info Window tells me that it's a ComboBox.

Can it be done using ControlCOmmands or could someone suggest anotehr approach?

Thanks in advance

I haven't got 8.1, but in version 7 the window title is the other way round, ie "Adobe Reader - [filename.pdf]."

Otherwise I can't see that you're doing anything wrong assuming you have the ID right.

Are you using the File|Print Setup option? You can choose the printer using Send("!N") and then send the name for the printer, like Send("Canon i850"), and send("!o") or Send("!a") for portrait or landscape.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

My fault - once again :D

I used the wrong window title! Now everything runs fine

Thanks very much for taking the time!


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hello Water,

I am working on this issue, too.

I found this code can print PDF file to default printer directly, really quick and convenient.

=============================

shellexecuteWait($PDFFileURL,"","","print")

=============================

wondering how to close adobe reader window after printing.

Hi AutoIt-Gurus,

I would like to automate the printing of PDF files using Adobe Acrobat Reader 8.1. For each file I would like to set the printer, orientation ...

I tried

ControlCommand($In & ".PDF - Adobe Reader","",1136,"SelectString",$Printer)
to select a printer from the combobox but it doesn't work.

I've read the Note in the AutoIt Help:

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

but AutoIt Info Window tells me that it's a ComboBox.

Can it be done using ControlCOmmands or could someone suggest anotehr approach?

Thanks in advance

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0