$pp->add_text($slide->link, { link => $slide->link });
# you may add pictures
$pp->add_picture($file, { left => 10, top => 10 });
}
$pp->save_presentation('slide.ppt');
$pp->close_presentation;
# PowerPoint closes automatically
=head1 DESCRIPTION
Win32::PowerPoint helps you to create a PowerPoint presentation. You can add texts/pictures incrementally to your slides.
=head1 METHODS
=head2 new
Invokes (or connects to) PowerPoint.
=head2 connect_or_invoke
Explicitly connects to (or invoke) PowerPoint.
=head2 quit
Explicitly disconnects from PowerPoint, and closes it if this module invoked it.
=head2 new_presentation (options)
Creates a new (probably blank) presentation. Options are:
=over 4
=item background_forecolor, background_backcolor
You can specify background colors of the slides with an array ref of RGB
components ([255, 255, 255] for white) or formatted string ('255, 0, 0'
for red). You can use '(0, 255, 255)' or 'RGB(0, 255, 255)' format for
clarity. These colors are applied to all the slides you'll add, unless
you specify other colors for the slides explicitly.
You can use 'masterbkgforecolor' and 'masterbkgbackcolor' as aliases.
=item pattern
You also can specify default background pattern for the slides.
See L<Win32::PowerPoint::Constants> (or MSDN or PowerPoint's help) for
supported pattern names. You can omit 'msoPattern' part and the names
are case-sensitive.
=back
=head2 save_presentation (path)
Saves the presentation to where you specified. Accepts relative path.
You might want to save it as .pps (slideshow) file to make it easy to
show slides (it just starts full screen slideshow with a doubleclick).
=head2 close_presentation
Explicitly closes the presentation.
=head2 new_slide (options)
Adds a new (blank) slide to the presentation. Options are:
=over 4
=item background_forecolor, background_backcolor
You can set colors just for the slide with these options.
You can use 'bkgforecolor' and 'bkgbackcolor' as aliases.
=item pattern
You also can set background pattern just for the slide.
=back
=head2 add_text (text, options)
Adds (formatted) text to the slide. Options are:
=over 4
=item left, top, width, height
of the Textbox.
=back
See 'decorate_range' for other options.
=head2 add_picture (file, options)
Adds file to the slide. Options are:
=over 4
=item left, top, width, height
of the picture. width and height are optional.
=item link
If set to true, the picture will be linked, otherwise, embedded.
=back
=head2 insert_before (text, options)
=head2 insert_after (text, options)
Prepends/Appends text to the current Textbox. See 'decorate_range' for options.
=head2 set_footer, set_master_footer (options)
Arranges (master) footer. Options are:
=over 4
=item visible
If set to true, the footer(s) will be shown, and vice versa.
=item text
Specifies the text part of the footer(s)
=item slide_number
If set to true, slide number(s) will be shown, and vice versa.
=item datetime
If set to true, the date time part of the footer(s) will be shown, and vice versa.
=item datetime_format
Specifies the date time format of the footer(s) if you specify one of the registered ppDateTimeFormat name (see L<Win32::PowerPoint::Constants> or MSDN for details). If set to false, no format will be used.
Font name of the text. You can use 'name' as an alias.
=item alignment
One of the 'left' (default), 'center', 'right', 'justify', 'distribute'.
You can use 'align' as an alias.
=item link
hyperlink address of the Text.
=back
(This method is mainly for the internal use).
=head1 IF YOU WANT TO GO INTO DETAIL
This module uses L<Win32::OLE> internally. You can fully control PowerPoint through the following accessors. See L<Win32::OLE> and other appropriate documents like intermediate books on PowerPoint and Visual Basic for details (after all, this module is just a thin wrapper of them). If you're still using old PowerPoint (2003 and older), try C<Record New Macro> (from the C<Tools> menu, then, C<Macro>, and voila) and do what you want, and see what's recorded (from the C<Tools> menu, then C<Macro>, and C<Macro...> submenu. You'll see Visual Basic Editor screen).
=head2 application
returns an Application object.
print $pp->application->Name;
=head2 presentation
returns a current Presentation object (maybe ActivePresentation but that's not assured).
while (my $last = $pp->presentation->Slides->Count) {
$pp->presentation->Slides($last)->Delete;
}
=head2 slide
returns a current Slide object.
$pp->slide->Export(".\\slide_01.jpg",'jpg');
$pp->slide->Shapes(1)->TextFrame->TextRange
->Characters(1, 5)->Font->{Bold} = $pp->c->True;
As of 0.10, you can pass an index number to get an arbitrary Slide object.
=head2 c
returns Win32::PowerPoint::Constants object.
=head1 CAVEATS FOR CYGWIN USERS
This module itself seems to work under the Cygwin environment. However, MS PowerPoint expects paths to be Windows-ish, namely without /cygdrive/. So, when you load or save a presentation, or import some materials with OLE (native) methods, you usually need to convert them by yourself. As of 0.08, Win32::PowerPoint::Utils has a C<convert_cygwin_path> function for this. Win32::PowerPoint methods use this function internally, so you don't need to convert paths explicitly.
=head1 AUTHOR
Kenichi Ishigaki, E<lt>ishigaki@cpan.orgE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2006- by Kenichi Ishigaki
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
Keyboard Shortcuts
Global
s
Focus search bar
?
Bring up this help dialog
GitHub
gp
Go to pull requests
gi
go to github issues (only if github is preferred repository)