fujibot has asked for the wisdom of the Perl Monks concerning the following question:

Hello. This is an edit to simplify my question.

How can I use Win32::OLE to open a pdf document and have the pdf VISIBLE on the computer screen?

This doesn't work right. No document displays.

#!usr/bin/perl use strict; use warnings; use Win32::OLE; use XML::Simple; my $acrobat = Win32::OLE->new("AcroExch.App", "Quit"); $acrobat->Show; my $avdoc = Win32::OLE->new("AcroExch.AVDoc"); $avdoc->Open( "c:\\scotta\\fotestfile4810.pdf" );

Replies are listed 'Best First'.
Re: Win32::OLE and Acrobat
by Corion (Patriarch) on Apr 13, 2010 at 15:13 UTC

    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";
      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!

Re: Win32::OLE and Acrobat
by roboticus (Chancellor) on Apr 13, 2010 at 15:49 UTC
Re: Win32::OLE and Acrobat
by Anonymous Monk on Apr 13, 2010 at 15:07 UTC
    So, my question is simple. How to Open and DISPLAY a pdf using Win32::OLE?

    find apropriate attribute or api call

      umm, thanks... any suggestions...? And in what order? I've tried SetViewMode, etc...