pub struct JsPresentation { /* private fields */ }Expand description
WASM-exposed Presentation builder
Implementations§
Source§impl JsPresentation
impl JsPresentation
pub fn new() -> Self
Set presentation author
Sourcepub fn set_subject(&mut self, subject: &str)
pub fn set_subject(&mut self, subject: &str)
Set presentation subject
Sourcepub fn set_company(&mut self, company: &str)
pub fn set_company(&mut self, company: &str)
Set presentation company
Sourcepub fn add_text(
&mut self,
slide_idx: usize,
text: &str,
opts_json: &str,
) -> Result<(), JsValue>
pub fn add_text( &mut self, slide_idx: usize, text: &str, opts_json: &str, ) -> Result<(), JsValue>
Add a text box to a slide opts_json: JSON string with fields: x, y, w, h, fontSize, bold, italic, align, color, fill
Sourcepub fn add_shape(
&mut self,
slide_idx: usize,
shape_type: &str,
opts_json: &str,
) -> Result<(), JsValue>
pub fn add_shape( &mut self, slide_idx: usize, shape_type: &str, opts_json: &str, ) -> Result<(), JsValue>
Add a shape to a slide shape_type: string like “rect”, “ellipse”, “triangle”, etc. opts_json: JSON string with fields: x, y, w, h, fill, line_color, line_width
Sourcepub fn add_image_base64(
&mut self,
slide_idx: usize,
b64: &str,
extension: &str,
opts_json: &str,
) -> Result<(), JsValue>
pub fn add_image_base64( &mut self, slide_idx: usize, b64: &str, extension: &str, opts_json: &str, ) -> Result<(), JsValue>
Add an image from a base64-encoded string extension: “png”, “jpg”, “gif”, “svg”, etc. opts_json: JSON string with fields: x, y, w, h, alt_text, transparency
Sourcepub fn add_table(
&mut self,
slide_idx: usize,
rows_json: &str,
opts_json: &str,
) -> Result<(), JsValue>
pub fn add_table( &mut self, slide_idx: usize, rows_json: &str, opts_json: &str, ) -> Result<(), JsValue>
Add a table from a JSON array of rows rows_json: JSON array of arrays of objects: [{text, bold, italic, colspan, rowspan, fill, color, align}, …] opts_json: JSON with: x, y, w, h, col_w (array of col widths)
Sourcepub fn set_background_color(&mut self, slide_idx: usize, color: &str)
pub fn set_background_color(&mut self, slide_idx: usize, color: &str)
Set the background color of a slide (hex string, e.g. “FF0000”)
Sourcepub fn write(&self) -> Result<Uint8Array, JsValue>
pub fn write(&self) -> Result<Uint8Array, JsValue>
Serialize the presentation to a Uint8Array (.pptx bytes)
Trait Implementations§
Source§impl From<JsPresentation> for JsValue
impl From<JsPresentation> for JsValue
Source§fn from(value: JsPresentation) -> Self
fn from(value: JsPresentation) -> Self
Source§impl FromWasmAbi for JsPresentation
impl FromWasmAbi for JsPresentation
Source§impl IntoWasmAbi for JsPresentation
impl IntoWasmAbi for JsPresentation
Source§impl LongRefFromWasmAbi for JsPresentation
impl LongRefFromWasmAbi for JsPresentation
Source§impl OptionFromWasmAbi for JsPresentation
impl OptionFromWasmAbi for JsPresentation
Source§impl OptionIntoWasmAbi for JsPresentation
impl OptionIntoWasmAbi for JsPresentation
Source§impl RefFromWasmAbi for JsPresentation
impl RefFromWasmAbi for JsPresentation
Source§type Anchor = RcRef<JsPresentation>
type Anchor = RcRef<JsPresentation>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for JsPresentation
impl RefMutFromWasmAbi for JsPresentation
Source§impl TryFromJsValue for JsPresentation
impl TryFromJsValue for JsPresentation
Source§impl VectorFromWasmAbi for JsPresentation
impl VectorFromWasmAbi for JsPresentation
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[JsPresentation]>
Source§impl VectorIntoWasmAbi for JsPresentation
impl VectorIntoWasmAbi for JsPresentation
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[JsPresentation]>) -> Self::Abi
Source§impl WasmDescribeVector for JsPresentation
impl WasmDescribeVector for JsPresentation
impl SupportsConstructor for JsPresentation
impl SupportsInstanceProperty for JsPresentation
impl SupportsStaticProperty for JsPresentation
Auto Trait Implementations§
impl Freeze for JsPresentation
impl RefUnwindSafe for JsPresentation
impl Send for JsPresentation
impl Sync for JsPresentation
impl Unpin for JsPresentation
impl UnsafeUnpin for JsPresentation
impl UnwindSafe for JsPresentation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.