Jump to content

Automate printing of PDF files


 Share

Recommended Posts

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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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.
Link to comment
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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...