Hi,
I try to create .ps files from RTF. The only way I know to do it is
printing with Word to PS printer file:

#Part of script convert.exe

my $Word = Win32::OLE->new('Word.Application', 'Quit');
$Word->{'Visible'} = 0;

$Word->Documents->Open("\"C:/test1.rtf\"")
    || die("Unable to open document ", Win32::OLE->LastError());

$Word->ActivePrinter("PostScript File");

$Word->ActiveDocument->PrintOut({

    OutputFileName => $output.ps,
    Background => 1,
    Append     => 0,
    Range      => wdPrintAllDocument,
    Item       => wdPrintDocumentContent,
    Copies     => 1,
    PageType   => wdPrintAllPages,
});

$Word->Documents->Close({
     SaveChanges => wdDoNotSaveChanges,
});

$Word->Quit;

This script works fine, but as I have a big number of RTF sources I am
thinking about to do this processes in a paralel mode wint WIN32::process:

for ($n=1; $n < $process; $n++)
{
     Win32::Process::Create($process1,
               "c:\\convert.exe",
               "convert $n",
               0,
               NORMAL_PRIORITY_CLASS,
               ".");
}

Some times it works well but others the problem that I receive are:
Windows errors: "Normal.dot is damaged", "Ms Word could'nt open
Normal.dot",
Perl errors: "Can't call method "Documents" on unblessed reference at
"convert.exe" ...

Any ideas ?

Thanks,

Ignacio.


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to