I'm trying to create a new 4:3 presentation, not 16:9.
I read this reference and write some ruby codes, but it didn't work. The new presentation's height is different from what I specified.
Method: presentations.create | Slides API | Google Developers
# foo.rb
require 'google/apis/slides_v1'
Slide = Google::Apis::SlidesV1 # alias
slides_service = Slide::SlidesService.new
# authorize...
new_presentation_object = Slide::Presentation.new(
title: "test",
page_size: Slide::Size.new(
width: Slide::Dimension.new(magnitude: 6_858_000, unit: 'EMU'),
height: Slide::Dimension.new(magnitude: 9_141_000, unit: 'EMU')
)
)
presentation = slide_service.create_presentation(new_presentation_object, fields: "pageSize,presentationId")
presentation.page_size
# => #<Google::Apis::SlidesV1::Size:0x007f99ef1fb630
# @height=#<Google::Apis::SlidesV1::Dimension:0x007f99ef1f8278 @magnitude=5143500, @unit="EMU">,
# @width=#<Google::Apis::SlidesV1::Dimension:0x007f99ef1fa550 @magnitude=9144000, @unit="EMU">>
How do I create a new 4:3 presentation?
I found no API to change PageSize but CreatePresentation, but any ideas to change PageSize are welcome.
I found a workaround for this problem.
Then, we get a new presentation. Though we can't decide PageSize dynamically, this works fine for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With