aligned_page_element_property {rgoogleslides} | R Documentation |
Convenience function to return a page element property that aligns said element
Description
The Googleslides do not provide convenient ways to align the element. In order to do the necessary calculation, one has to be do take into account the slide size as well as image size.
Usage
aligned_page_element_property(
slide_page_id,
slide_page_height = 5143500,
slide_page_width = 9144000,
image_height = NULL,
image_width = NULL,
align = "center"
)
Arguments
slide_page_id |
The id of the slide page that is to be altered |
slide_page_height |
The slide page height. It is set to default of 9144000 |
slide_page_width |
The slide page width. It is set to default of 5143500 |
image_height |
Image height in pt. Optional for align mode 'full' |
image_width |
Image width in pt. Optional for align mode 'full' |
align |
Alignment mode that is to be selected. 'center' or 'full' is accepted. |
Details
The following pointers are thought of when doing the following calculations.
The image is to be scaled without any distortions. No skews etc
The translation coordinates of an image is defined by the top left corner of the image
The following function will not query the Googleslides API to retrieve the page size automatically. The user would need to obtain that information and feed it into this function. This is to prevent this function from overutilizing the API unnecessarily when utilizing this function