Jump to content

Multiple PDF's print to multiple network printers

Recommended Posts

Hello all! This is my first post and I'm very new to AutoIt so I may be in over my head with what I'm trying to accomplish. I've done a ton of searching on the forums and google and have found parts of information that could help me but I'm having trouble putting it all together.

Here's what I'm trying to accomplish:

I'm saving a single PDF file from an application that contains multiple employee schedules categorized by each department they work in.

Here's where the autoit kicks in:

1. I want to use Autosplit Pro (acrobat 10 plugin) to separate the different departments and save a new pdf for each department (I've got this working so far)

2. I want to send each department pdf to the corresponding department printer over our network. I'm assuming the easiest way would be to have a 2-dimensional array containing all the department names and the corresponding printer.

I'm having trouble with figuring out how to print over a network to a specified printer. It also seems to me from my searches that there is no way to print silently from the command line in adobe 10?

Any help would be appreciated.


Link to comment
Share on other sites

  • Moderators

Hi, RoxorLoops, welcome to the forum. There are a couple of ways you can print the PDF documents. The link below has a discussion both on the older method (DDE) and a newer method further down for printing from Acrobat Pro. That may give you some insight into the method you'll need to create.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

That helps a ton thank you! Also I feel dumb for asking this but in order to print to a network printer called "pannetprint1" where do I insert the printer name in the command:

ShellExecute("AcroRD32.exe","/h /p"&" """&$FnToPrt&"""" ,"","", @SW_HIDE )

I find it confusing with all the quotes.

Link to comment
Share on other sites

Here the 2 command line option for printing:

AcroRd32.exe /p filename

=> Executes the Reader and prints a file to the default printer.

AcroRd32.exe /t path printername drivername portname

=> Initiates Acrobat Reader, prints a file while suppressing the Acrobat print dialog box, then terminates Reader.

-printername = The name of your printer.

-drivername = Your printer driver’s name. Whatever appears in the Driver Used box when you view your printer’s properties.

-portname — The printer’s port. portname cannot contain any "/" characters; if it does, output is routed to the default port for that printer.

If using Acrobat, substitute Acrobat.exe in place of AcroRd32.exe in the command lines.

It's from an older doc, maybe the behavior changed a little bit, but should still work.

br, Reinhard

Link to comment
Share on other sites

Ok I've been messing around with this all day and can't figure it out. I would assume that the line:

$FnToPrt = "C:Documents and Settingsafowler2Desktoptest.pdf"

ShellExecute("AcroRD32.exe","/h /p test.pdf panABDHADMINLP1"&" """&$FnToPrt&"""" ,"","",@SW_HIDE )

would print the file "test.pdf" to the network printer "panABDHADMINLP1" but it doesn't it says file cannot be found.

If I just use ShellExecute("AcroRD32.exe","/h /p"&" """&$FnToPrt&"""" ,"","",@SW_HIDE )

It will print to my default printer but that's not what I want. Any help is appreciated.


Link to comment
Share on other sites

$params = StringFormat('/h /t "%s" "%s" "%s" "%s"', $sPDF, $sPrinter, $sDriver, $sPort)
ShellExecute($sAcroExe, $params)

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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

  • Recently Browsing   0 members

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