Paragraph Indentation and Spacing
This guide will show you how to work with line spacing in text.
Before you begin
You should get your API key from your UniCloud account.
If this is your first time using UniOffice SDK, follow this guide to set up a local development environment.
Clone the project repository
In your terminal, clone the examples repository. It contains the Go code we will be using for this guide.
git clone https://github.com/unidoc/unioffice-examples
To get the example navigate to the path
document/paragraph_spacing_and_indentation folder in the unioffice-examples directory.
How it works
4-12 import the UniOffice packages and other required dependencies.
The init function in lines
14-21 authenticates your request with your
In the main function in lines
23-47, a new document is generated, and a variable named
lorem, which holds text, is defined. Next, a new paragraph is created, comprising a single run that inserts the content of the
lorem variable twice. Subsequently, a blank line is inserted beneath this paragraph using the
Following this, the same operations are repeated, but this time specifying the line spacing using the
Finally, the document is validated and saved.
Run the code
Run this command to create a new document with line spacing.
go run main.go