in reply to Win32::OLE and Acrobat

I use the following code to print PDF through the default printer:

my @cmd = (q("C:\\Program Files\\Adobe\\Reader 9.0\\Reader\\AcroRd32.e +xe"), '/h', '/p', $file ); system( @cmd ) == 0 or warn "$? / $! / $^E";

Replies are listed 'Best First'.
Re^2: Win32::OLE and Acrobat
by fujibot (Initiate) on Apr 13, 2010 at 15:54 UTC
    Thanks. This almost works, but I can't get past the system call. The program "hangs" here until I manually kill acrobat. How can I get the program to continue to process code?
    my @cmd = (q("C:\\Program Files\\Adobe\\Acrobat 9.0\\Acrobat\\Acrobat. +exe"), $file); system( @cmd );

      I use to bring PDFs into Postscript by this method. The trick in this case is to have an instance of acrobat already opened.

      Try: open Acrobat manually. Start your program, a frame may be visible but will vanish and your program will continue.

      my code:

      my $pddoc = Win32::OLE->new("AcroExch.PDDoc"); $bef = "\"c:\\Program Files\\Adobe\\Acrobat 8.0\\Acrobat\\acrobat.exe\ +""; $bef.= " /n /s /o /h /t $inpfil \"DT6180PS_9111\" \"Xerox DT6180 PS3 v +2.0\" \"/\""; system( $bef );

      works perfect. I redirect the output to a printer, where the application redmon redirects the output to a file. By this way you can get any printercode to a file in a command mode. Good luck!