PoiScript / docx-rs

A Rust library for parsing and generating docx files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Another api for creating paragraph and style

PoiScript opened this issue · comments

let docx = Docx::new();

// both `style` and `paragraph` are keeped inside
// the docx, no more scope problem to worry
let style = docx.create_style("Test Paragraph Style")
  .with_color("FF200")
  .with_sz(40);

let mut paragraph = docx.create_paragraph("This text is styled"); // returning a muttable reference

paragraph.with_style_name(&style);