Xul2ppt_mec.pm - convert .xul to .ppt on Win32 Platform mechanically
use strict; use warnings; use Win32::Xul2ppt_mec; my $obj = Win32::Xul2ppt_mec->new( 'range' => [1, 10], 'interval' => 1, 'dir' => 'D:/tmp', 'name' => 'sample.ppt', ); $obj->shoot(); #catch screen from mozilla firefox and generate images #$obj->trim(); #trim the intermediate images $obj->to_ppt(); #insert the images into your ppt
Note: (If you want to convert directly, please consult the bundled Xul2ppt utilities.)
This module provides an interface to convert .xul files to .ppt files with virtual or mechanical method. By the interfaces of controlling keys and mouse automacally provided by Win32::Guitest, you can convert your .xul to .ppt in free time. To do so, Win32::Guitest module installer is prerequired. And if you need to trim the pictures to get a mini-ppt files Image-Magic installer also prerequired.
$obj->new()
my $obj = Win32::Xul2ppt_mec->new( 'range' => [1, 10], 'interval' => 1, 'dir' => 'D:/tmp', 'name' => 'sample.ppt', );
The attributes of the Xul2ppt_mec are described below, in the ATTRIBUTES section.
$obj->shoot()
Before invoking this method, please make sure that your .xul file has already been opened by mozilla firefox and the window not minimized.
$obj->trim()
After shooting terminates, pictures of your .xul files displayed on mozilla firefox are catched and saved under a certain directory. However, some blemish remains in the raw pictures, further trimming the pictures are strongly recommended. Two command lines provided by Imagic-Magic are invoking:
"convert -crop +0+25 $file $file"
"convert -trim $file $file".
$obj->to_ppt();
Automacally inserts pictures into your .ppt files. Before running, powerpoint should be started and not minimized!
$obj->{'range'} Set the start and end index of .xul shooted
$obj->{'interval'}
set the interval of seconds between each mechanical operation, if it runs on a fast machine, you can shorten it. 2 seconds is default value.
$obj->{'dir'}
set the directory, under which all the intermediate files will be saved. and 'D:\tmp' is default;
$obj->{'name'}
set the name of your .ppt file, 'sample.ppt' is default
xul2ppt [ -r "[num1, num2]" | -i num | -d string | -n string ] xul2ppt.pl
-r See $obj->{'range'}
-i See $obj->{'interval'}
-d See $obj->{'dir'}
-n See $obj->{'name'}
set the format of the intermediate images. '.png' is default.
Sal Zhong (Zhong Wei Xiang)
zhongxiang721@gmail.com
Copyright (c) 2006 Sal Zhong. All rights reserved.
To install Win32::Xul2ppt_mec, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Win32::Xul2ppt_mec
CPAN shell
perl -MCPAN -e shell install Win32::Xul2ppt_mec
For more information on module installation, please visit the detailed CPAN module installation guide.