### Quick Start: Convert Office Document to PDF (Native) Source: https://docs.rs/office2pdf/0.5.0/office2pdf/index.html Use this for a straightforward conversion of an Office document to PDF using the default settings. Requires file system access. ```rust let result = office2pdf::convert("report.docx").unwrap(); std::fs::write("report.pdf", &result.pdf).unwrap(); ``` -------------------------------- ### Default ConvertOptions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/config/struct.ConvertOptions.html Provides the default configuration for ConvertOptions. This is useful when you need a basic setup without specifying every option. ```rust fn default() -> ConvertOptions ``` -------------------------------- ### Get File Extension for ImageFormat Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/enum.ImageFormat.html Returns the file extension corresponding to the specified image format. This is useful for naming output files. ```rust pub fn extension(&self) -> &'static str ``` -------------------------------- ### Get Substitute Font Names - Rust Source: https://docs.rs/office2pdf/0.5.0/office2pdf/render/font_subst/fn.substitutes.html Call this function with a font family name to get a list of preferred metric-compatible substitute font names. Returns `None` if the font is not a known Microsoft font with open-source alternatives. ```rust pub fn substitutes(font_family: &str) -> Option<&'static [&'static str]> ``` -------------------------------- ### Try Component Conversions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.TabStop.html Attempting to convert color components into a collection of colors. ```APIDOC ## impl TryComponentsInto for T where C: TryFromComponents ### type Error = >::Error The error for when `try_into_colors` fails to cast. ### fn try_components_into(self) -> Result>::Error> Try to cast this collection of color components into a collection of colors. ``` -------------------------------- ### Implement Positioned for FloatingImage Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.FloatingImage.html Provides methods to get the position (x, y) and dimensions (width, height) of a FloatingImage. ```rust fn x(&self) -> f64 ``` ```rust fn y(&self) -> f64 ``` ```rust fn width(&self) -> f64 ``` ```rust fn height(&self) -> f64 ``` -------------------------------- ### From and Into Traits Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/enum.ListKind.html Demonstrates the fundamental From and Into traits for type conversions. ```APIDOC ## From for T ### Description Returns the argument unchanged. ### Method `fn from(t: T) -> T` ## Into for T ### Description Calls `U::from(self)`. This conversion is whatever the implementation of `From for U` chooses to do. ### Method `fn into(self) -> U` ``` -------------------------------- ### Get Paper Dimensions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/config/enum.PaperSize.html Returns the width and height of a PaperSize variant in points. Useful for calculations or rendering. ```rust pub fn dimensions(&self) -> (f64, f64) ``` -------------------------------- ### TryFrom and TryInto Conversions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/config/struct.ConvertOptions.html Utilities for attempting conversions that may fail. ```APIDOC ### impl TryFrom for T #### fn try_from(value: U) -> Result>::Error> ### Description where U: Into, Performs the conversion. ### impl TryInto for T #### fn try_into(self) -> Result>::Error> ### Description where U: TryFrom, Performs the conversion. ### impl TryIntoColor for T #### fn try_into_color(self) -> Result> ### Description where U: TryFromColor, Convert into T, returning ok if the color is inside of its defined range, otherwise an `OutOfBounds` error is returned which contains the unclamped color. Read more ``` -------------------------------- ### Any Trait Implementation Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/enum.LineSpacing.html Provides a way to get the TypeId of a value. This is part of the standard library for runtime type identification. ```rust impl Any for T where T: 'static + ?Sized, Source§ #### fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. Read more Source ``` -------------------------------- ### TabStop Blanket Implementations Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.TabStop.html Demonstrates blanket implementations for TabStop, showing its compatibility with various generic traits. ```APIDOC ## Blanket Implementations for TabStop TabStop implements several blanket traits, including: - **AdaptInto**: For adapting color types. - **Any**: For runtime type identification. - **ArraysFrom/ArraysInto**: For converting between color collections and arrays. - **Az**: For casting values. - **Borrow/BorrowMut**: For borrowing references. - **Cam16IntoUnclamped**: For color space conversions. - **CastFrom**: For casting from other types. - **CheckedAs/CheckedCastFrom**: For safe casting with optional results. - **CloneToUninit**: For cloning to uninitialized memory (nightly experimental). - **ComponentsFrom**: For converting color collections to components. - **Filterable**: For creating filterable data providers. - **Finish**: For consuming the value. - **From**: For creating a type from itself. - **FromAngle**: For converting from angles. - **FromStimulus**: For converting from stimulus types. ``` -------------------------------- ### Configuration Options Source: https://docs.rs/office2pdf/0.5.0/office2pdf/all.html Details on the configuration structs and enums used for customizing the conversion process, including document format, paper size, and conversion settings. ```APIDOC ## Configuration Options ### Structs #### `config::ConvertOptions` - **Description**: Structure to hold various options for the conversion process. - **Fields**: (Details not provided in source, but would typically include settings for page ranges, output format, etc.) #### `config::SlideRange` - **Description**: Represents a range of slides for conversion. - **Fields**: (Details not provided in source, but would typically include start and end slide numbers.) ### Enums #### `config::Format` - **Description**: Enum representing the output format. Likely includes PDF and potentially others. - **Variants**: (Details not provided in source, but would typically include `Pdf`.) #### `config::PaperSize` - **Description**: Enum representing standard paper sizes. - **Variants**: `A4`, `Letter`, `Legal`, etc. (Details not provided in source.) #### `config::PdfStandard` - **Description**: Enum specifying PDF standards for output. - **Variants**: (Details not provided in source, but would typically include `PdfA1b`, `PdfA2b`, etc.) ``` -------------------------------- ### Define PptxParser Struct Source: https://docs.rs/office2pdf/0.5.0/office2pdf/parser/pptx/struct.PptxParser.html Defines the PptxParser struct, used for parsing PPTX files. No specific setup is required to use this struct. ```rust pub struct PptxParser; ``` -------------------------------- ### Convert Office Document to PDF with Options (Native) Source: https://docs.rs/office2pdf/0.5.0/office2pdf/index.html Convert an Office document to PDF with custom options such as paper size and slide range. Requires file system access and specific imports. ```rust use office2pdf::config::{ConvertOptions, PaperSize, SlideRange}; let options = ConvertOptions { paper_size: Some(PaperSize::A4), slide_range: Some(SlideRange::new(1, 5)), ..Default::default() }; let result = office2pdf::convert_with_options("slides.pptx", &options).unwrap(); std::fs::write("slides.pdf", &result.pdf).unwrap(); ``` -------------------------------- ### ListItem Struct Definition Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.ListItem.html Defines the structure of a list item, containing its content, indentation level, and an optional starting number for ordered lists. ```rust pub struct ListItem { pub content: Vec, pub level: u32, pub start_at: Option, } ``` -------------------------------- ### Component Conversion (TryComponentsInto) Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.SheetPage.html Methods for attempting to convert a collection of components into a collection of colors. ```APIDOC ## impl TryComponentsInto for T ### Description Attempts to convert a collection of components of type `T` into a collection of colors of type `C`. Requires `C` to implement `TryFromComponents`. ### Associated Types - **Error** (>::Error): The error type returned if the conversion fails. ``` ```APIDOC ## fn try_components_into(self) -> Result>::Error> ### Description Try to cast this collection of color components into a collection of colors. ### Method `try_components_into` ### Parameters - **self** (T) - The collection of components to convert. ``` -------------------------------- ### Ownership and Conversion Utilities Source: https://docs.rs/office2pdf/0.5.0/office2pdf/error/enum.ConvertWarning.html Utilities for handling ownership, object conversion, and string representation. ```APIDOC ## Ownership and Conversion Utilities Utilities for handling ownership, object conversion, and string representation. ### `impl ToOwnedObj for T` where U: FromObjRef, #### `fn to_owned_obj(&self, data: FontData<'_>) -> U` Convert this type into `T`, using the provided data to resolve any offsets. ### `impl ToOwnedTable for T` where U: FromTableRef, #### `fn to_owned_table(&self) -> U` ### `impl ToString for T` where T: Display + ?Sized, #### `fn to_string(&self) -> String` Converts the given value to a `String`. ### `impl UintsFrom for U` where C: IntoUints, #### `fn uints_from(colors: C) -> U` Cast a collection of colors into a collection of unsigned integers. ### `impl UintsInto for U` where C: FromUints, #### `fn uints_into(self) -> C` Cast this collection of unsigned integers into a collection of colors. ``` -------------------------------- ### Finish Implementation Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.Color.html Provides a `finish` method that does nothing but move `self`, equivalent to `drop`. ```APIDOC ## impl Finish for T ### Description Does nothing but move `self`, equivalent to `drop`. ### Method `finish` ### Endpoint N/A (Method Implementation) ### Parameters None ### Request Example None ### Response None ### Response Example None ``` -------------------------------- ### Conversion Traits Overview Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.DataBarInfo.html Documentation for standard and custom conversion traits including Into, TryInto, and casting utilities. ```APIDOC ## Into for T ### Description Converts a value of type T into type U using the From trait implementation. ### Method into(self) -> U ## IntoEither for T ### Description Converts a type into an Either variant based on a boolean condition. ### Methods - into_either(self, into_left: bool) -> Either - into_either_with(self, into_left: F) -> Either ## SaturatingAs for T ### Description Provides saturating casting functionality between types. ### Methods - saturating_as(self) -> Dst - saturating_cast_from(src: Src) -> Dst ## Pointable for T ### Description Defines traits for types that can be pointed to, including alignment and memory management. ### Methods - init(init: ::Init) -> usize - deref<'a>(ptr: usize) -> &'a T - deref_mut<'a>(ptr: usize) -> &'a mut T - drop(ptr: usize) ``` -------------------------------- ### Default TextStyle Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.TextStyle.html Provides the default TextStyle configuration. This is useful for creating a base style before applying specific modifications. ```rust fn default() -> TextStyle ``` -------------------------------- ### Blanket Implementations Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/enum.CellVerticalAlign.html Showcases blanket implementations for generic types, demonstrating conversions and utility functions. ```APIDOC ## Blanket Implementations ### impl AdaptInto for S * `fn adapt_into_using(self, method: M) -> D`: Convert the source color to the destination color using the specified method. * `fn adapt_into(self) -> D`: Convert the source color to the destination color using the bradford method by default. ### impl Any for T * `fn type_id(&self) -> TypeId`: Gets the `TypeId` of `self`. ### impl ArraysFrom for T * `fn arrays_from(colors: C) -> T`: Cast a collection of colors into a collection of arrays. ### impl ArraysInto for T * `fn arrays_into(self) -> C`: Cast this collection of arrays into a collection of colors. ### impl Az for T * `fn az(self) -> Dst`: Casts the value. ### impl Borrow for T * `fn borrow(&self) -> &T`: Immutably borrows from an owned value. ### impl BorrowMut for T * `fn borrow_mut(&mut self) -> &mut T`: Mutably borrows from an owned value. ### impl Cam16IntoUnclamped for U * `type Scalar = >::Scalar` * `fn cam16_into_unclamped( self, parameters: BakedParameters>::Scalar>, ) -> T`: Converts `self` into `C`, using the provided parameters. ### impl CastFrom for Dst * `fn cast_from(src: Src) -> Dst`: Casts the value. ### impl CheckedAs for T * `fn checked_as(self) -> Option`: Casts the value. ### impl CheckedCastFrom for Dst * `fn checked_cast_from(src: Src) -> Option`: Casts the value. ### impl CloneToUninit for T * `unsafe fn clone_to_uninit(&self, dest: *mut u8)`: Performs copy-assignment from `self` to `dest`. ### impl ComponentsFrom for T * `fn components_from(colors: C) -> T`: Cast a collection of colors into a collection of color components. ### impl Equivalent for Q * `fn equivalent(&self, key: &K) -> bool`: Checks if this value is equivalent to the given key. ### impl Equivalent for Q * `fn equivalent(&self, key: &K) -> bool`: Compare self to `key` and return `true` if they are equal. ### impl Filterable for T * `fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider) -> bool>`: Creates a filterable data provider with the given name for debugging. ``` -------------------------------- ### Color Conversion (TryIntoColor) Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.FixedPage.html Documentation for converting types into colors with range validation. ```APIDOC ## fn try_into_color(self) -> Result> ### Description Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. ### Response #### Success Response (200) - **Result>** (Result) - The converted color or an OutOfBounds error. ``` -------------------------------- ### TryInto and TryFrom Conversions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/error/struct.ConvertResult.html Covers `TryInto` and `TryFrom` traits for fallible conversions, where conversion might fail and return a `Result`. ```APIDOC ## TryInto for T ### Description Provides a method to attempt conversion into type `U`, returning a `Result`. ### Method `try_into(self) -> Result>::Error>` ### Endpoint N/A (Trait method) ### Parameters None ### Request Example N/A ### Response N/A ## TryFrom for T ### Description Provides a method to attempt conversion from type `U` into `Self`, returning a `Result`. ### Method `try_from(value: U) -> Result>::Error>` ### Endpoint N/A (Trait method) ### Parameters - **value** (U) - Required - The value to attempt conversion from. ### Request Example N/A ### Response N/A ``` -------------------------------- ### Implement Default for Metadata Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.Metadata.html Allows creating a Metadata struct with default values. Use this when initializing metadata fields that might not be present. ```rust fn default() -> Metadata ``` -------------------------------- ### Into and From Conversions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/error/struct.ConvertResult.html Demonstrates the basic `Into` and `From` traits for infallible type conversions. `T: Into` is equivalent to `U: From`. ```APIDOC ## Into for T ### Description Provides a method to convert `self` into type `U`. ### Method `into_angle(self) -> U` ### Endpoint N/A (Trait method) ### Parameters None ### Request Example N/A ### Response N/A ## From for U ### Description Provides a method to convert from type `T` into `Self`. ### Method `from(value: T) -> Self` ### Endpoint N/A (Trait method) ### Parameters - **value** (T) - Required - The value to convert from. ### Request Example N/A ### Response N/A ``` -------------------------------- ### TryComponentsInto Conversion Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.GradientFill.html Attempts to convert a collection of components into a collection of colors. ```APIDOC ## impl TryComponentsInto for T ### Description Attempts to convert `self` (a collection of components) into a collection of colors of type `C`. ### Associated Type - **Error** (>::Error) - The error type returned if the conversion fails. ### Method `fn try_components_into(self) -> Result>::Error>` ### Endpoint N/A (Trait implementation) ### Parameters - **self** (T) - The collection of components to convert. ### Request Example N/A ### Response - **Result** - Ok(C) on success, Err(Error) on failure. ``` -------------------------------- ### Convert File to PDF with Options Source: https://docs.rs/office2pdf/0.5.0/office2pdf/fn.convert_with_options.html Use this function to convert a file to PDF bytes with customizable options. Not available on wasm32 targets; use `convert_bytes` for in-memory conversion on WASM. Returns `ConvertError` on failure. ```rust pub fn convert_with_options( path: impl AsRef, options: &ConvertOptions, ) -> Result ``` -------------------------------- ### TryComponentsInto Conversion Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.FlowPage.html Methods for attempting to convert components into a collection of colors. ```APIDOC ## impl TryComponentsInto for T ### Description Attempts to cast this collection of color components into a collection of colors `C`. ### Method `try_components_into` ### Return Value - Result>::Error> - Ok(C) on success, Err on failure. ``` -------------------------------- ### TryInto Conversions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.FlowPage.html Provides methods for attempting conversions between types, returning a Result. ```APIDOC ## TryInto for T ### Description Provides methods for attempting conversions between types, returning a Result. ### Method `try_into` ### Endpoint N/A (Trait method) ### Parameters None ### Request Body None ### Request Example None ### Response #### Success Response (Result>::Error>) - The converted value of type `U` if successful. #### Error Response (Result>::Error>) - An error of type `>::Error` if the conversion fails. ### Response Example None ``` -------------------------------- ### Type Conversion: TryComponentsInto Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.FixedPage.html Attempts to convert a collection of components into a collection of colors. ```APIDOC ## impl TryComponentsInto for T ### Description Attempts to convert this collection of color components into a collection of colors `C`. ### Associated Type - **Error**: `>::Error` - The error type returned if the conversion fails. ### Method `try_components_into` ### Parameters - **self** (T) - The collection of components to convert. ### Returns - `Result` - The collection of colors if successful, or an error if conversion fails. ``` -------------------------------- ### Try Conversions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.List.html Provides methods for attempting conversions that may fail. ```APIDOC ## impl TryFrom for T ### Description Performs the conversion, returning a `Result`. ### Types - `Error`: `Infallible` - The type returned in the event of a conversion error. ### Method `fn try_from(value: U) -> Result>::Error>` ### Endpoint N/A (Trait implementation) ### Parameters - `value` (U) - The value to convert. ``` ```APIDOC ## impl TryInto for T ### Description Attempts to convert `self` into `U`. ### Method `fn try_into(self) -> Result>::Error>` ### Endpoint N/A (Trait implementation) ### Parameters None ``` ```APIDOC ## impl TryComponentsInto for T ### Description Try to cast this collection of color components into a collection of colors. ### Types - `Error`: `>::Error` - The error for when `try_into_colors` fails to cast. ### Method `fn try_components_into(self) -> Result>::Error>` ### Endpoint N/A (Trait implementation) ### Parameters None ``` -------------------------------- ### TryFrom Conversion Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.Shadow.html Generic implementation for attempting conversions using `TryFrom`. ```APIDOC ## impl TryFrom for T ### Description Provides a generic implementation for attempting conversion from `U` to `T`. ### Types - **Error**: `Infallible` - The error type, indicating infallible conversion in this context. ### Parameters - **U** (Type) - The source type. - **T** (Type) - The target type. ``` -------------------------------- ### Pointer and Initialization Trait Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/enum.Alignment.html Methods for managing memory pointers and initialization. ```APIDOC ## Pointable for T ### Description Provides methods for interacting with raw pointers and memory management. ### Constants - **ALIGN** (usize) - The alignment requirement for the type. ### Types - **Init** (T) - The type used for initializers. ### Methods #### `init(init: ::Init) -> usize` Initializes memory with the given initializer and returns a pointer to the allocated memory. #### `deref<'a>(ptr: usize) -> &'a T` Dereferences a raw pointer to get an immutable reference to the value. #### `deref_mut<'a>(ptr: usize) -> &'a mut T` Dereferences a raw pointer to get a mutable reference to the value. #### `drop(ptr: usize)` Drops the object pointed to by the given pointer. ### Endpoint N/A (Trait implementation) ``` -------------------------------- ### Into Implementation Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.HeaderFooter.html Provides a generic conversion from one type to another, provided the destination type implements From. ```rust fn into(self) -> U where U: From, ``` -------------------------------- ### Define HEADING_FONT_SIZES Source: https://docs.rs/office2pdf/0.5.0/office2pdf/defaults/constant.HEADING_FONT_SIZES.html Default font sizes for heading levels 1-6. Index 0 = Heading 1, index 5 = Heading 6. ```rust pub const HEADING_FONT_SIZES: [f64; 6]; ``` -------------------------------- ### Component Conversions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.Shadow.html Methods for attempting conversions between collections of components and colors. ```APIDOC ## impl TryComponentsInto for T ### Description Attempts to cast a collection of color components into a collection of colors. ### Types - **Error**: `>::Error` - The error type returned if the conversion fails. ### Method `try_components_into` ### Parameters - **self** (T) - The collection of components to convert. ### Returns - `Result` - The collection of colors if successful, or an error otherwise. ``` -------------------------------- ### TryIntoColor Conversion Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.CellBorder.html Handles color conversions with bounds checking. ```APIDOC ## impl TryIntoColor for T ### Description Handles color conversions with bounds checking. ### Source ```rust Source ``` ## fn try_into_color(self) -> Result> ### Description Convert into T, returning ok if the color is inside of its defined range, otherwise an `OutOfBounds` error is returned which contains the unclamped color. Read more ### Source ```rust Source ``` ``` -------------------------------- ### convert_with_options Source: https://docs.rs/office2pdf/0.5.0/office2pdf/index.html Converts a file at the given path to PDF bytes using specific conversion options. ```APIDOC ## convert_with_options(path: &str, options: &ConvertOptions) ### Description Converts a file at the given path to PDF bytes with configurable options such as paper size and slide ranges. ### Parameters - **path** (string) - Required - The file system path to the Office document. - **options** (ConvertOptions) - Required - Configuration object for the conversion process. ``` -------------------------------- ### TryInto Conversions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.Shape.html Provides methods for attempting conversions between types, returning a Result to handle potential errors. ```APIDOC ## impl TryInto for T ### Description Provides methods for attempting conversions between types, returning a Result to handle potential errors. ### Methods #### fn try_from(value: U) -> Result>::Error> Performs the conversion. #### type Error = >::Error The type returned in the event of a conversion error. #### fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### Same Implementation Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/enum.ImageFormat.html Implementation of the Same trait. ```APIDOC ## type Output = T ### Description Should always be `Self`. ### Method N/A (This appears to be a type alias within an implementation block) ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **T** - The type itself. ``` -------------------------------- ### TryComponentsInto for T Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/enum.HFInline.html Attempts to convert a collection of color components `T` into a collection of colors `C`. ```APIDOC ## TryComponentsInto for T ### Description Attempts to convert a collection of color components `T` into a collection of colors `C`. ### Type Aliases - `Error = >::Error`: The error type returned if the conversion fails. ### Method `try_components_into(self) -> Result>::Error>` ### Details Requires `C` to implement `TryFromComponents`. ``` -------------------------------- ### TryFrom and TryComponentsInto Traits Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.ColumnLayout.html Traits for fallible conversions, including converting components into colors. ```APIDOC ## impl TryComponentsInto for T ### Description Attempts to convert a collection of color components into a collection of colors, returning a `Result`. ### Types - **Error**: `>::Error` - The error type returned if the conversion fails. ### Method `try_components_into` ### Parameters - **self** (T) - The collection of color components to convert. ### Response - **Result** - A `Result` containing the converted colors or an error. ``` ```APIDOC ## impl TryFrom for T ### Description Provides a fallible way to convert a type `U` into a type `T`, returning a `Result`. ### Types - **Error**: `Infallible` - The error type, indicating this conversion is infallible if `U: Into`. ### Method `try_from` (implicitly via `Into` if `Error` is `Infallible`) ``` -------------------------------- ### Implement PartialEq for Insets Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.Insets.html Allows for equality comparison between Insets instances. This enables checking if two Insets values are identical. ```rust fn eq(&self, other: &Insets) -> bool ``` ```rust fn ne(&self, other: &Rhs) -> bool ``` -------------------------------- ### TryComponentsInto Conversion Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.Chart.html Attempts to convert a collection of color components into a collection of colors. ```APIDOC ## impl TryComponentsInto for T ### Description Try to cast this collection of color components into a collection of colors. ### Method `fn try_components_into(self) -> Result>::Error>` ### Endpoint N/A (Method within a struct/impl block) ### Parameters None ``` -------------------------------- ### Trait Implementations for DataBarInfo Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.DataBarInfo.html Details various trait implementations for the DataBarInfo struct, including Clone, Debug, and several blanket implementations for color and data conversions. ```APIDOC ## Trait Implementations for DataBarInfo ### impl Clone for DataBarInfo - `clone(&self) -> DataBarInfo`: Returns a duplicate of the value. - `clone_from(&mut self, source: &Self)`: Performs copy-assignment from `source`. ### impl Debug for DataBarInfo - `fmt(&self, f: &mut Formatter<'_>) -> Result`: Formats the value using the given formatter. ### Blanket Implementations - `AdaptInto`: Converts colors using specified methods. - `Any`: Provides `type_id` for runtime type identification. - `ArraysFrom` and `ArraysInto`: Casts between color collections and array collections. - `Az`: Casts the value to a different type. - `Borrow` and `BorrowMut`: Provides immutable and mutable borrowing. - `Cam16IntoUnclamped`: Converts to CAM16 color space. - `CastFrom` and `CheckedCastFrom`: Type casting functionalities. - `CloneToUninit`: Unsafe experimental API for cloning to uninitialized memory. - `ComponentsFrom`: Casts color collections to component collections. - `Filterable`: Creates a filterable data provider for debugging. - `Finish`: Does nothing but move `self`, equivalent to `drop`. - `From`: Returns the argument unchanged. - `FromAngle`: Performs a conversion from an angle. - `FromStimulus`: Converts from another type with scaling and clamping. - `Instrument`: Instruments the type with a `Span` for tracing. ``` -------------------------------- ### Finish Implementation Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/enum.ImageFormat.html Implementation of the Finish trait, equivalent to drop. ```APIDOC ## fn finish(self) ### Description Does nothing but move `self`, equivalent to `drop`. ### Method N/A (This appears to be a method within an implementation block) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None (This method consumes `self` and returns nothing). ``` -------------------------------- ### Try Conversions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.NamedStyle.html Traits for attempting conversions that may fail, returning a `Result`. ```APIDOC ## impl TryComponentsInto for T ### Description Attempts to convert a collection of components `T` into a collection of colors `C`. ### Method `try_components_into()` ### Endpoint N/A (Trait implementation) ### Parameters None ### Request Example N/A ### Response - **Result>::Error>** - A `Result` containing the converted colors or an error. - **Error** (Type Alias) - The error type for conversion failures. ``` ```APIDOC ## fn try_components_into(self) -> Result>::Error> ### Description Try to cast this collection of color components into a collection of colors. ### Method `fn` ### Endpoint N/A (Method within a struct/enum implementation) ### Parameters None ### Request Example N/A ### Response - **Result** (Result) - `Ok(C)` on success, `Err(E)` on failure. ``` ```APIDOC ## impl TryFrom for T ### Description Provides a fallible way to convert a type `U` into a type `T`, returning a `Result`. ### Method `try_from()` ### Endpoint N/A (Trait implementation) ### Parameters None ### Request Example N/A ### Response - **Result>::Error>** - A `Result` containing the converted value or an error. - **Error** (Type Alias) - The error type for conversion failures, typically `Infallible`. ``` ```APIDOC ## fn try_from(value: U) -> Result>::Error> ### Description Performs the conversion from `value` of type `U` to `T`. Returns `Ok(T)` on success or `Err(E)` on failure. ### Method `fn` ### Endpoint N/A (Method within a struct/enum implementation) ### Parameters - **value** (U) - The value to convert. ### Request Example N/A ### Response - **Result** (Result) - `Ok(T)` on success, `Err(E)` on failure. ``` ```APIDOC ## impl TryInto for T ### Description Provides a fallible way to convert a type `T` into a type `U`, returning a `Result` if `U` implements `TryFrom`. ### Method `try_into()` ### Endpoint N/A (Trait implementation) ### Parameters None ### Request Example N/A ### Response - **Result>::Error>** - A `Result` containing the converted value or an error. ``` -------------------------------- ### ConvertOptions Configuration Source: https://docs.rs/office2pdf/0.5.0/office2pdf/config/struct.ConvertOptions.html Configuration options for controlling the document conversion process. ```APIDOC ## ConvertOptions ### Description Options controlling the conversion process for office documents to PDF. ### Request Body - **sheet_names** (Option>) - Optional - Filter XLSX sheets by name. Only sheets in this list are included. - **slide_range** (Option) - Optional - Filter PPTX slides by range (1-indexed). - **pdf_standard** (Option) - Optional - PDF standard to enforce (defaults to 1.7). - **paper_size** (Option) - Optional - Override paper size for the output PDF. - **font_paths** (Vec) - Required - Additional font directories to search. - **landscape** (Option) - Optional - Force landscape orientation. - **tagged** (bool) - Required - Enable tagged PDF output for accessibility. - **pdf_ua** (bool) - Required - Enable PDF/UA compliance. - **streaming** (bool) - Required - Enable streaming mode for large file processing. - **streaming_chunk_size** (Option) - Optional - Chunk size in rows for streaming mode (defaults to 1000). ``` -------------------------------- ### Implement `From` for `T` Source: https://docs.rs/office2pdf/0.5.0/office2pdf/config/enum.Format.html This implementation of `From` for `T` provides a `from` method that returns the argument unchanged. It's a basic identity conversion. ```rust impl From for T { fn from(t: T) -> T { t } } ``` -------------------------------- ### VZip Implementation Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/enum.ShapeKind.html Implementation of VZip for types that support MultiLane. ```APIDOC ## impl VZip for T ### Method #### `vzip` `fn vzip(self) -> V` ``` -------------------------------- ### Clone TextStyle Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.TextStyle.html Creates a duplicate of an existing TextStyle. This is a standard implementation for copying formatting configurations. ```rust fn clone(&self) -> TextStyle ``` -------------------------------- ### In-Memory Conversion of Office Document Bytes to PDF (WASM Compatible) Source: https://docs.rs/office2pdf/0.5.0/office2pdf/index.html Perform conversion directly from byte slices, suitable for all targets including WASM. Specify the input format and use default options. ```rust use office2pdf::config::{ConvertOptions, Format}; let docx_bytes = std::fs::read("report.docx").unwrap(); let result = office2pdf::convert_bytes(&docx_bytes, Format::Docx, &ConvertOptions::default()).unwrap(); std::fs::write("report.pdf", &result.pdf).unwrap(); ``` -------------------------------- ### Into Conversions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.Chart.html Provides methods for converting between types using `From` trait implementations. ```APIDOC ## impl Into for T ### Description Provides the `into` method for type conversions. ### Method `fn into(self) -> U` ### Endpoint N/A (Method within a struct/impl block) ### Parameters None ### Request Body None ### Response None ``` -------------------------------- ### TryComponentsInto for T Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.FloatingTextBox.html Provides a method to try converting components into a target type `C`, returning an error if the conversion fails. ```APIDOC ## type Error = >::Error ### Description The error for when `try_into_colors` fails to cast. ### Type Alias `Error` ``` -------------------------------- ### From Implementation Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/enum.ImageFormat.html Implementation of the From trait, returning the argument unchanged. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method N/A (This appears to be a method within an implementation block) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **T** - The input argument `t`. ``` -------------------------------- ### TryInto Conversion Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.ColumnLayout.html Provides functionality for attempting conversions between types, returning a Result. ```APIDOC ## impl TryInto for T ### Description Provides methods for attempting conversions between types. ### Methods #### fn try_from(value: U) -> Result>::Error> Performs the conversion. #### type Error = >::Error The type returned in the event of a conversion error. #### fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### TryInto Conversion Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.CellBorder.html Provides functionality to attempt conversion between types. ```APIDOC ## fn try_into(self) -> Result>::Error> ### Description Performs the conversion. ### Source ```rust Source ``` ``` -------------------------------- ### Implement Default for Margins Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.Margins.html Provides a default value for the Margins struct. This is useful when a default margin configuration is needed. ```rust fn default() -> Self ``` -------------------------------- ### Clone Implementation for Document Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.Document.html Provides functionality to create a duplicate of a Document instance. This is useful for preserving original document states or for performing operations on copies. ```rust fn clone(&self) -> Document ``` ```rust fn clone_from(&mut self, source: &Self) ``` -------------------------------- ### UintsFrom and UintsInto Conversions Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.ColumnLayout.html Facilitates casting between collections of colors and collections of unsigned integers. ```APIDOC ## impl UintsFrom for U ### Description Casts a collection of colors into a collection of unsigned integers. ### Methods #### fn uints_from(colors: C) -> U Cast a collection of colors into a collection of unsigned integers. ## impl UintsInto for U ### Description Casts a collection of unsigned integers into a collection of colors. ### Methods #### fn uints_into(self) -> C Cast this collection of unsigned integers into a collection of colors. ``` -------------------------------- ### Color Struct API Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.Color.html Documentation for the Color struct, including its fields, constructor, and predefined color constants. ```APIDOC ## Struct Color ### Description RGB color. ### Fields - **r** (u8) - Red component. - **g** (u8) - Green component. - **b** (u8) - Blue component. ### Methods #### `new(r: u8, g: u8, b: u8) -> Self` Create a color from RGB components. #### `black() -> Self` Black (`#000000`). #### `white() -> Self` White (`#FFFFFF`). ``` -------------------------------- ### ComponentsFrom for T Source: https://docs.rs/office2pdf/0.5.0/office2pdf/ir/struct.ParagraphStyle.html Converts a collection of colors into a collection of color components. ```APIDOC #### fn components_from(colors: C) -> T ### Description Cast a collection of colors into a collection of color components. ### Parameters - **colors** (C) - The collection of colors to convert. ### Response Example ```json { "example": "T" } ``` ```