View Source Idmlx.Updater (idmlx v0.2.1)
A module for updating the contents of an .idms file, including page items, styles, and colors. Supports updating TextFrames, Rectangles, and inserting Character, Paragraph, and Object styles.
Summary
Functions
Updates colors in the IDMS document.
Updates the contents of an .idms file with style definitions and content updates.
Functions
Updates colors in the IDMS document.
Updates the contents of an .idms file with style definitions and content updates.
Parameters
- payload: Map containing styles, colors and items to update:
- paragraph_styles: List of paragraph style definitions
- character_styles: List of character style definitions
- object_styles: List of object style definitions
- colors: List of color definitions
- items: List of items to update with their content
- file_path: The path to the .idms file or URL to be updated.
- new_file_path: Optional path for the updated file (defaults to "./updated.idms").
Examples
iex> payload = %{
...> paragraph_styles: [style_def],
...> items: [%{name: "text1", type: :text_frame, content: "New content"}]
...> }
iex> Idmlx.Updater.update_idms(payload, "path/to/file.idms")
:ok
iex> Idmlx.Updater.update_idms(payload, "https://example.com/template.idms")
:ok