View Source IDMLx

Logo

IDMLx is an Elixir library for parsing IDML/IDMS files from Adobe InDesign into Elixir structs. These structs can be filled with data and exported to various formats such as KonvaJS canvas, PNG, HTML, or PDFs.

Features

  • Parse IDML/IDMS files into Elixir structs
  • Manipulate and fill structs with data
  • Export data to various formats including KonvaJS canvas, PNG, HTML, and PDFs

Installation

Add idmlx to your list of dependencies in mix.exs:

def deps do
  [
    {:idmlx, "~> 0.1.0"}
  ]
end

Usage

Reading IDMS files

# Read an IDMS file
spread = Idmlx.read_idms("path/to/file.idms")

# Extract text frames
text_frames = Idmlx.text_frames(spread)

# Extract images
images = Idmlx.images(spread)

Exporting to KonvaJS

# Export to KonvaJS format
konva_json = Idmlx.export_to_konva(spread)

# Export with custom text assignments
konva_json = Idmlx.export_to_konva(spread, %{
  "TextFrame1" => "Custom text content"
})

# Export in wireframe mode
konva_json = Idmlx.export_to_konva(spread, %{}, mode: :wireframes)

Updating IDMS files

# Update an IDMS file with modified spread
Idmlx.update_idms(spread, "path/to/original.idms", "path/to/updated.idms")

Documentation

Full documentation can be found at https://hexdocs.pm/idmlx.

License

This project is licensed under the MIT License - see the LICENSE file for details.