EnzoXenon has asked for the wisdom of the Perl Monks concerning the following question:
In the Constants.pm module I've added the following to define the page names to the enumeration from the Microsoft documentation
ppSlideSize35MM => 4, ppSlideSizeA3Paper => 9, ppSlideSizeA4Paper => 3, ppSlideSizeB4ISOPaper => 10, ppSlideSizeB4JISPaper => 12, ppSlideSizeB5ISOPaper => 11, ppSlideSizeB5JISPaper => 13, ppSlideSizeBanner => 6, ppSlideSizeCustom => 7, ppSlideSizeHagakiCard => 14, ppSlideSizeLedgerPaper => 8, ppSlideSizeLetterPaper => 2, ppSlideSizeOnScreen => 1, ppSlideSizeOverhead => 5,
In the PowerPoint.pm module I've added a method to alter the page setup like this
sub page_setup { my ($self, $options) = @_; $options = {} unless ref $options eq 'HASH'; $self->presentation->PageSetup->SlideSize($options->{slidesize}); $self->presentation->PageSetup->SlideWidth($options->{width}); $self->presentation->PageSetup->SlideHeight($options->{height}); }
In my call to this function I try to set the slide size with no luck
# Set the slide size $PPT->page_setup( { slidesize => 'ppSlideSizeLetterPaper', width => 11*72, height => 8.5*72 } );
When I debug the code and print out the slide information ... from within PowerPoint.pm from this code
print "\nPowerPoint.pm(): slide size=" . $self->presentation->PageSetu +p->SlideSize . "\n"; print "PowerPoint.pm(): width=" . $self->presentation->PageSetup->Sl +ideWidth . "\n"; print "PowerPoint.pm(): height=" . $self->presentation->PageSetup->Sl +ideHeight . "\n\n";
I list out the options called (they seem to be right) and get the answers like this
So, I can properly read the current values but I can't set new ones. Any wisdom would be greatly apprecaited.PowerPoint.pm(): options: slidesize=ppSlideSizeLetterPaper height=612 width=792 PowerPoint.pm(): slide size=7 PowerPoint.pm(): width=960 PowerPoint.pm(): height=540
Your humble apprentice formerly registered as nzsvz9 but can't find or fix his login so newly creating this EnzoXenon account
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::PowerPoint extension
by Anonymous Monk on May 20, 2023 at 10:47 UTC | |
by EnzoXenon (Acolyte) on May 20, 2023 at 17:11 UTC | |
by EnzoXenon (Acolyte) on May 26, 2023 at 17:32 UTC | |
by Bod (Parson) on May 26, 2023 at 18:46 UTC | |
by kcott (Archbishop) on May 26, 2023 at 19:06 UTC | |
by Bod (Parson) on May 26, 2023 at 21:27 UTC | |
|