With the Doc API
Describe the document as content blocks, set role styles once, and callbuild.
1
Create a Doc
2
Set role styles
Styles assigned per role apply to every block of that type.
3
Add content
4
Build the file
Explore the Doc API
Blocks, inline content, styling, fonts, formulas, tables, charts, and more.
With the Document API
Build elements with the page factories, then place them withpage.add.
Explore the Document API
Elements, containers, layout, tables, themes, and positioning.
Choosing an API
Use Doc when
You are writing a document: a report, an article, an invoice. You want pagination, headers,
and footers handled for you.
Use Document when
You need exact coordinates, custom layouts, overlapping elements, or per element control.